Protect uninitialized scalar variable from being accessed
In a couple of cases a variable "stayopen" can be checked unitialized. This is of no danger as the complementary condition is false but prevent the access by switching the checks. CID: 1018729 CID: 1018732
This commit is contained in:
parent
3e318877fe
commit
9ad953310c
@ -896,7 +896,7 @@ files_group(void *retval, void *mdata, va_list ap)
|
||||
break;
|
||||
pos = ftello(st->fp);
|
||||
}
|
||||
if (!stayopen && st->fp != NULL) {
|
||||
if (st->fp != NULL && !stayopen) {
|
||||
fclose(st->fp);
|
||||
st->fp = NULL;
|
||||
}
|
||||
|
@ -921,7 +921,7 @@ files_passwd(void *retval, void *mdata, va_list ap)
|
||||
errnop);
|
||||
} while (how == nss_lt_all && !(rv & NS_TERMINATE));
|
||||
fin:
|
||||
if (!stayopen && st->db != NULL) {
|
||||
if (st->db != NULL && !stayopen) {
|
||||
(void)st->db->close(st->db);
|
||||
st->db = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user