diff options
author | Guy Harris <guy@alum.mit.edu> | 2019-02-06 12:57:28 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-02-06 12:57:28 -0800 |
commit | f3bcb37f7986503455cbc5becc5960b7dc0d075b (patch) | |
tree | 3daaa15beb9092124a9344fa49ba2b120d17f1c8 /pcap-rpcap.c | |
parent | 8d27f83067b03c6e49be86bdf2a4a2f829aebdb2 (diff) | |
download | libpcap-f3bcb37f7986503455cbc5becc5960b7dc0d075b.tar.gz |
Cleanly handle pcap_createsrcstr() errors.
Go to the error label, don't just immediately return, so that, for
example, we discard the rest of the "find all devices" reply.
Diffstat (limited to 'pcap-rpcap.c')
-rw-r--r-- | pcap-rpcap.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pcap-rpcap.c b/pcap-rpcap.c index 2e21ba0f..64b66c99 100644 --- a/pcap-rpcap.c +++ b/pcap-rpcap.c @@ -2566,8 +2566,9 @@ pcap_findalldevs_ex_remote(const char *source, struct pcap_rmtauth *auth, pcap_i tmpstring[findalldevs_if.namelen] = 0; /* Create the new device identifier */ - if (pcap_createsrcstr(tmpstring2, PCAP_SRC_IFREMOTE, host, port, tmpstring, errbuf) == -1) - return -1; + if (pcap_createsrcstr(tmpstring2, PCAP_SRC_IFREMOTE, + host, port, tmpstring, errbuf) == -1) + goto error; stringlen = strlen(tmpstring2); |