From 8bb23841e9c6f44c5d865d2340df4449de63c1cd Mon Sep 17 00:00:00 2001 From: ckolivas Date: Fri, 29 Jan 2016 07:31:28 +1100 Subject: [PATCH] Prevent crash in empty string passed to json_strcpy --- src/libckpool.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libckpool.h b/src/libckpool.h index 0faf8447..141b2839 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -331,7 +331,7 @@ void _json_check(json_t *val, json_error_t *err, const char *file, const char *f /* No error checking with these, make sure we know they're valid already! */ static inline void json_strcpy(char *buf, json_t *val, const char *key) { - strcpy(buf, json_string_value(json_object_get(val, key))); + strcpy(buf, json_string_value(json_object_get(val, key)) ? : ""); } static inline void json_dblcpy(double *dbl, json_t *val, const char *key)