mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-01-03 15:21:41 +01:00
json: Avoid calling strlen(NULL)
MIME parts may have no filename, which previously resulted in calling strlen(NULL).
This commit is contained in:
parent
cdd64727f1
commit
cacefbf3d6
1 changed files with 3 additions and 0 deletions
3
json.c
3
json.c
|
@ -105,5 +105,8 @@ json_quote_chararray(const void *ctx, const char *str, const size_t len)
|
|||
char *
|
||||
json_quote_str(const void *ctx, const char *str)
|
||||
{
|
||||
if (str == NULL)
|
||||
str = "";
|
||||
|
||||
return (json_quote_chararray (ctx, str, strlen (str)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue