From: Jim Radford Date: Sat, 10 Aug 2013 16:10:56 +0000 (-0700) Subject: curl_json plugin: avoid unlikely overrun X-Git-Tag: collectd-5.4.1~3^2~12 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=d130204df3256c39e104aa9a4346d116458c745e curl_json plugin: avoid unlikely overrun Signed-off-by: Florian Forster --- diff --git a/src/curl_json.c b/src/curl_json.c index deee460b..89fce164 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -500,6 +500,7 @@ static int cj_config_add_key (cj_t *db, /* {{{ */ len = ptr-name; if (len == 0) break; + len = COUCH_MIN(len, sizeof (ent)-1); sstrncpy (ent, name, len+1); if (c_avl_get (tree, ent, (void *) &value) != 0)