mirror of https://github.com/OISF/suricata
log/tlsstore: improve path handling
Use PathMerge.
Address format truncation warnings.
log-tlsstore.c: In function 'CreateFileName':
log-tlsstore.c:68:9: warning: '%s' directive output may be truncated writing likely 1 or more bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
68 | if (snprintf(path, sizeof(path), "%s/%s%ld.%ld-%d.pem", tls_logfile_base_dir, dir,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69 | (long int)SCTIME_SECS(p->ts), (long int)SCTIME_USECS(p->ts),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 | file_id) == sizeof(path))
| ~~~~~~~~
log-tlsstore.c:68:9: note: assuming directive output of 1 byte
log-tlsstore.c:68:9: note: directive argument in the range [0, 17592186044415]
log-tlsstore.c:68:9: note: directive argument in the range [0, 1048575]
log-tlsstore.c:68:9: note: using the range [-2147483648, 2147483647] for directive argument
log-tlsstore.c:68:9: note: 'snprintf' output 11 or more bytes (assuming 4126) into a destination of size 4096
Ticket: #7905.
pull/13926/head
parent
98730c2c43
commit
840d372320
Loading…
Reference in New Issue