diff options
author | agnosticdev <agnosticdev@gmail.com> | 2018-10-08 21:18:52 -0500 |
---|---|---|
committer | agnosticdev <agnosticdev@gmail.com> | 2018-10-08 21:18:52 -0500 |
commit | 50301a252f4debdbaf1f66f97999a1807ca0e488 (patch) | |
tree | 51ef16dea4c5e2d82fcec2c206e35b20834bc578 /tcpdump.c | |
parent | 51eefc7c84f6791de120c3944387cff1c16a84de (diff) | |
download | tcpdump-50301a252f4debdbaf1f66f97999a1807ca0e488.tar.gz |
return-checks: Added a return check for malloc and for strsep
Diffstat (limited to 'tcpdump.c')
-rw-r--r-- | tcpdump.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1156,6 +1156,9 @@ _U_ */ endp++; /* Include the trailing / in the URL; pcap_findalldevs_ex() requires it */ host_url = malloc(endp - url + 1); + if (host_url == NULL && (endp - url + 1) > 0) + error("Invalid allocation for host"); + memcpy(host_url, url, endp - url); host_url[endp - url] = '\0'; status = pcap_findalldevs_ex(host_url, NULL, &devlist, ebuf); |