Fix a logic bug in error handling code. It is an error if p == NULL.
The linelen tests are only meaningful when p != NULL. Reported by: Coverity Coverity CID: 1368655 MFC after: 1 month
This commit is contained in:
parent
349ee9cd62
commit
f9e1d0b7ba
@ -542,7 +542,7 @@ swap_on_off_md(const char *name, char *mntops, int doingall)
|
||||
goto err;
|
||||
}
|
||||
p = fgetln(sfd, &linelen);
|
||||
if (p == NULL &&
|
||||
if (p == NULL ||
|
||||
(linelen < 2 || linelen > sizeof(linebuf))) {
|
||||
warn("mdconfig (attach) unexpected output");
|
||||
ret = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user