X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fstring-util.c;fp=util%2Fstring-util.c;h=9c46a81a58e20030b586953e577efd777ef2af17;hp=27f8a26b4938c4c770486e504b62f168db64f582;hb=0756d2587220898bdeec2067363a74629411093b;hpb=8aeba1228ace947c1b689ae6ae08db5d53755917 diff --git a/util/string-util.c b/util/string-util.c index 27f8a26b..9c46a81a 100644 --- a/util/string-util.c +++ b/util/string-util.c @@ -53,7 +53,7 @@ strsplit_len (const char *s, char delim, size_t *len) count++; } - if (count==0) + if (count == 0) return NULL; *len = count; @@ -183,6 +183,7 @@ parse_boolean_term (void *ctx, const char *str, /* Parse prefix */ str = skip_space (str); const char *pos = strchr (str, ':'); + if (! pos || pos == str) goto FAIL; *prefix_out = talloc_strndup (ctx, str, pos - str);