mirror of https://github.com/OISF/suricata
output/lua: work around format truncation warnings
Use PathMerge to improve path handling and address these warnings:
output-lua.c: In function 'OutputLuaLogInitSub':
output-lua.c:657:48: warning: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size between 0 and 4096 [-Wformat-truncation=]
657 | int ret = snprintf(path, sizeof(path),"%s%s%s", dir, strlen(dir) ? "/" : "", conf->val);
| ^~
output-lua.c:657:43: note: assuming directive output of 1 byte
657 | int ret = snprintf(path, sizeof(path),"%s%s%s", dir, strlen(dir) ? "/" : "", conf->val);
| ^~~~~~~~
output-lua.c:657:15: note: 'snprintf' output 1 or more bytes (assuming 4098) into a destination of size 4096
657 | int ret = snprintf(path, sizeof(path),"%s%s%s", dir, strlen(dir) ? "/" : "", conf->val);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ticket: #7905.
pull/13926/head
parent
99a79b595f
commit
7bab39d447
Loading…
Reference in New Issue