diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-04-05 12:33:31 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-04-07 11:44:35 +0200 |
commit | ceddcac74a6eafae8d959adcbfee17d4cae2c3a8 (patch) | |
tree | bd7c719bfc30063c3b8ee1f69e227e4176793ff4 /conf.c | |
parent | e46f67f15230e07ef35f4f54126a47ef5a60238b (diff) | |
download | passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar.gz passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar.bz2 passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar.lz passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar.xz passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.tar.zst passt-ceddcac74a6eafae8d959adcbfee17d4cae2c3a8.zip |
conf, tap: False "Buffer not null terminated" positives, CWE-170
Those strings are actually guaranteed to be NULL-terminated. Reported
by Coverity.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1035,7 +1035,7 @@ void conf(struct ctx *c, int argc, char **argv) usage(argv[0]); } - ret = snprintf(c->sock_path, sizeof(c->sock_path), "%s", + ret = snprintf(c->sock_path, UNIX_SOCK_MAX - 1, "%s", optarg); if (ret <= 0 || ret >= (int)sizeof(c->pcap)) { err("Invalid socket path: %s", optarg); @@ -1048,9 +1048,9 @@ void conf(struct ctx *c, int argc, char **argv) usage(argv[0]); } - ret = snprintf(c->pasta_ifn, sizeof(c->pasta_ifn), "%s", + ret = snprintf(c->pasta_ifn, IFNAMSIZ - 1, "%s", optarg); - if (ret <= 0 || ret >= (int)sizeof(c->pasta_ifn)) { + if (ret <= 0 || ret >= IFNAMSIZ - 1) { err("Invalid interface name: %s", optarg); usage(argv[0]); } |