mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
Cherry-pick 5d3c5151c2b885aab36627bafb8539238da27b2d, it fixes use after free
if tcpdump(1) is run on non-existent interface. Suggested by: zeising
This commit is contained in:
parent
11bc2c1ca7
commit
f97074045b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=317409
@ -1085,9 +1085,9 @@ open_interface(const char *device, netdissect_options *ndo, char *ebuf)
|
||||
/*
|
||||
* Return an error for our caller to handle.
|
||||
*/
|
||||
pcap_close(pc);
|
||||
snprintf(ebuf, PCAP_ERRBUF_SIZE, "%s: %s\n(%s)",
|
||||
device, pcap_statustostr(status), cp);
|
||||
pcap_close(pc);
|
||||
return (NULL);
|
||||
} else if (status == PCAP_ERROR_PERM_DENIED && *cp != '\0')
|
||||
error("%s: %s\n(%s)", device,
|
||||
|
Loading…
Reference in New Issue
Block a user