mirror of
https://github.com/PDP-10/klh10.git
synced 2026-04-14 15:55:39 +00:00
Avoid using uninitialized 'pname' in 'pfopen()'
This commit is contained in:
22
src/osdnet.c
22
src/osdnet.c
@@ -1705,19 +1705,19 @@ pfopen(char *basename, struct tuntap_context *tt_ctx, struct osnpf *osnpf)
|
||||
(void) snprintf(pfname, BASENAMESIZE, "%s%d", basename, i++);
|
||||
fd = open(pfname, O_RDWR, 0);
|
||||
} while (fd < 0 && errno == EBUSY); /* If device busy, keep looking */
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
/* Note possible error meanings:
|
||||
ENOENT - no such filename
|
||||
ENXIO - not configured in kernel
|
||||
*/
|
||||
esfatal(1, "Couldn't find or open packetfilter device, last tried %s",
|
||||
pfname);
|
||||
}
|
||||
if (fd >= 0) {
|
||||
basenamecpy(osnpf->osnpf_ifnam, pfname, IFNAM_LEN);
|
||||
} else {
|
||||
/* Note possible error meanings:
|
||||
ENOENT - no such filename
|
||||
ENXIO - not configured in kernel
|
||||
*/
|
||||
esfatal(1, "Couldn't find or open packetfilter device, last tried %s",
|
||||
pfname);
|
||||
};
|
||||
};
|
||||
|
||||
tt_ctx->my_tap = TRUE;
|
||||
basenamecpy(osnpf->osnpf_ifnam, pfname, IFNAM_LEN);
|
||||
|
||||
return fd; /* Success! */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user