From 1190302c13f2eac4ab9e9144c3980cb216879bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 27 Oct 2015 17:17:44 +0100 Subject: ui: make color parsing more robust --- ui-curses.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui-curses.c b/ui-curses.c index eb6acff..66f7828 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -421,6 +421,8 @@ static int color_find_rgb(unsigned char r, unsigned char g, unsigned char b) /* Convert color from string. */ static int color_fromstring(const char *s) { + if (!s) + return -1; if (*s == '#' && strlen(s) == 7) { const char *cp; unsigned char r, g, b; -- cgit v1.2.3