output: debug validation about stack allocations

Ticket: 8001

For flow variables names
pull/14337/head
Philippe Antoine 3 weeks ago committed by Victor Julien
parent 42d6c85757
commit 3337617a5e

@ -198,6 +198,7 @@ static void EveAddPacketVars(const Packet *p, SCJsonBuilder *js_vars)
if (pv->key != NULL) {
uint32_t offset = 0;
DEBUG_VALIDATE_BUG_ON(pv->key_len > UINT16_MAX);
uint8_t keybuf[pv->key_len + 1];
PrintStringsToBuffer(keybuf, &offset, pv->key_len + 1, pv->key, pv->key_len);
SCJbSetPrintAsciiString(js_vars, (char *)keybuf, pv->value, pv->value_len);
@ -267,6 +268,7 @@ static void EveAddFlowVars(const Flow *f, SCJsonBuilder *js_root, SCJsonBuilder
break;
}
// fv->keylen is uint16
uint8_t keybuf[fv->keylen + 1];
uint32_t offset = 0;
PrintStringsToBuffer(keybuf, &offset, fv->keylen + 1, fv->key, fv->keylen);

Loading…
Cancel
Save