From: Jim Radford Date: Sat, 10 Aug 2013 16:14:27 +0000 (-0700) Subject: curl_json plugin: avoid accessing off the end of the avl_tree_s X-Git-Tag: collectd-5.4.1~3^2~11 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=2aefd2f1927ab78258d8ad218eb5a351d668d412;p=collectd.git curl_json plugin: avoid accessing off the end of the avl_tree_s It's not written this way, but really we have a union { *key; *tree; } which is differentiated by checking for the presence a magic field which only exists in key. This leads to accesses off the end of the tree. Putting the magic at start of the key avoids this. Signed-off-by: Florian Forster --- diff --git a/src/curl_json.c b/src/curl_json.c index 89fce164..009f718d 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -48,10 +48,10 @@ struct cj_key_s; typedef struct cj_key_s cj_key_t; struct cj_key_s /* {{{ */ { + unsigned long magic; char *path; char *type; char *instance; - unsigned long magic; }; /* }}} */