From 2aefd2f1927ab78258d8ad218eb5a351d668d412 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Sat, 10 Aug 2013 09:14:27 -0700 Subject: [PATCH] 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 --- src/curl_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }; /* }}} */ -- 2.11.0