aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--color.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/color.c b/color.c
index 81c267672..a9eadd190 100644
--- a/color.c
+++ b/color.c
@@ -207,6 +207,9 @@ int color_parse_mem(const char *value, int value_len, char *dst)
struct color fg = { COLOR_UNSPECIFIED };
struct color bg = { COLOR_UNSPECIFIED };
+ if (!len)
+ return -1;
+
if (!strncasecmp(value, "reset", len)) {
xsnprintf(dst, end - dst, GIT_COLOR_RESET);
return 0;