commit b65817262b3a275ecd0ef1898d92ec5508a9f810
Author: David Edmondson <[email protected]>
Date: Tue Apr 6 08:24:00 2010 +0100
json: Avoid calling strlen(NULL)
MIME parts may have no filename, which previously resulted in calling
strlen(NULL).
Modified json.c
diff --git a/json.c b/json.c
index f90b0fa..b73f22a 100644
--- a/json.c
+++ b/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)
+ return (char *)"\"\"";
+
return (json_quote_chararray (ctx, str, strlen (str)));
}
dme.
--
David Edmondson, http://dme.org
_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch