diff options
author | David Edmondson <dme@dme.org> | 2010-04-06 08:24:00 +0100 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-20 08:54:51 -0700 |
commit | cacefbf3d6dd5bce0b60b3cdfce29bfa371dfaea (patch) | |
tree | ecc3a9d0346b55071cfa414ad27e35ca1511c13d /json.c | |
parent | cdd64727f197bf9e24b89da768d75bf268b8fb1c (diff) |
json: Avoid calling strlen(NULL)
MIME parts may have no filename, which previously resulted in calling
strlen(NULL).
Diffstat (limited to 'json.c')
-rw-r--r-- | json.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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))); } |