module/script: initialize string tags from our NULL-terminated ‘value’

`_value` is a pointer into the receive buffer, and may not be NULL
terminated, and may also contain data belonging to the next tag.
This commit is contained in:
Daniel Eklöf 2020-10-30 10:55:27 +01:00
parent 9945fce2d2
commit 37447cd955
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -106,7 +106,7 @@ process_line(struct module *mod, const char *line, size_t len)
struct tag *tag = NULL;
if (type_len == 6 && memcmp(type, "string", 6) == 0)
tag = tag_new_string(mod, name, _value);
tag = tag_new_string(mod, name, value);
else if (type_len == 3 && memcmp(type, "int", 3) == 0) {
long value = strtol(_value, NULL, 0);