diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-04-05 11:55:35 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-04-07 11:44:35 +0200 |
commit | e46f67f15230e07ef35f4f54126a47ef5a60238b (patch) | |
tree | 3ad588f66eab6ef2987a982454dc5f35fca9554f /conf.c | |
parent | eb3d3f367ea09b89d54f177ded1e874611d1020f (diff) | |
download | passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar.gz passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar.bz2 passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar.lz passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar.xz passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.tar.zst passt-e46f67f15230e07ef35f4f54126a47ef5a60238b.zip |
conf: False "Assign instead of compare" positive, CWE-481
This really just needs to be an assignment before line_read() --
turn it into a for loop. Reported by Coverity.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -288,7 +288,7 @@ static void get_dns(struct ctx *c) if ((fd = open("/etc/resolv.conf", O_RDONLY | O_CLOEXEC)) < 0) goto out; - while (!(*buf = 0) && line_read(buf, BUFSIZ, fd)) { + for (*buf = 0; line_read(buf, BUFSIZ, fd); *buf = 0) { if (!dns_set && strstr(buf, "nameserver ") == buf) { p = strrchr(buf, ' '); if (!p) |