summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d130204)
raw | patch | inline | side by side (parent: d130204)
author | Jim Radford <radford@galvanix.com> | |
Sat, 10 Aug 2013 16:14:27 +0000 (09:14 -0700) | ||
committer | Florian Forster <octo@collectd.org> | |
Mon, 19 Aug 2013 14:52:04 +0000 (16:52 +0200) |
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 <octo@collectd.org>
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 <octo@collectd.org>
src/curl_json.c | patch | blob | history |
diff --git a/src/curl_json.c b/src/curl_json.c
index 89fce164e02b0bdd96855a6a670ffa7d5dd810b5..009f718d4d81ea22d5437d35f3ac9d94d1079428 100644 (file)
--- a/src/curl_json.c
+++ b/src/curl_json.c
typedef struct cj_key_s cj_key_t;
struct cj_key_s /* {{{ */
{
+ unsigned long magic;
char *path;
char *type;
char *instance;
- unsigned long magic;
};
/* }}} */