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>
typedef struct cj_key_s cj_key_t;
struct cj_key_s /* {{{ */
{
+ unsigned long magic;
char *path;
char *type;
char *instance;
- unsigned long magic;
};
/* }}} */