The description is not guaranteed to be present.

Inspired from d1b556c5c5/src/tfe/tfearch.c (L129)

See as well

https://www.tcpdump.org/manpages/pcap_findalldevs.3pcap.html
This commit is contained in:
Andrea Odetti 2021-04-17 20:26:09 +01:00
parent 4c51309e3b
commit be8eee37b5

View file

@ -249,7 +249,10 @@ int tfe_arch_enumadapter(char **ppname, char **ppdescription)
return 0;
*ppname = lib_stralloc(TfePcapNextDev->name);
*ppdescription = lib_stralloc(TfePcapNextDev->description);
if (TfePcapNextDev->description)
*ppdescription = lib_stralloc(TfePcapNextDev->description);
else
*ppdescription = lib_stralloc(TfePcapNextDev->name);
TfePcapNextDev = TfePcapNextDev->next;