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>
This commit is contained in:
parent
eb3d3f367e
commit
e46f67f152
1 changed files with 1 additions and 1 deletions
2
conf.c
2
conf.c
|
@ -288,7 +288,7 @@ static void get_dns(struct ctx *c)
|
||||||
if ((fd = open("/etc/resolv.conf", O_RDONLY | O_CLOEXEC)) < 0)
|
if ((fd = open("/etc/resolv.conf", O_RDONLY | O_CLOEXEC)) < 0)
|
||||||
goto out;
|
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) {
|
if (!dns_set && strstr(buf, "nameserver ") == buf) {
|
||||||
p = strrchr(buf, ' ');
|
p = strrchr(buf, ' ');
|
||||||
if (!p)
|
if (!p)
|
||||||
|
|
Loading…
Reference in a new issue