mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
POSIX: PCAP: Check header & data before using
This commit is contained in:
@@ -140,7 +140,7 @@ void PCAP::Find(std::vector<FoundDevice>& found) {
|
||||
struct pcap_pkthdr* header;
|
||||
const uint8_t* data;
|
||||
auto res = pcap_next_ex(iface.fp, &header, &data);
|
||||
if(res < 0) {
|
||||
if(res < 0 || !header || !data) {
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
EventManager::GetInstance().add(APIEvent::Type::PCAPCouldNotFindDevices, APIEvent::Severity::EventWarning);
|
||||
|
||||
Reference in New Issue
Block a user