mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 07:11:37 +00:00
Resolves crash opportunities caused by unexpected libpcap version string format. Fixes #1112
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
#Nmap Changelog ($Id$); -*-text-*-
|
#Nmap Changelog ($Id$); -*-text-*-
|
||||||
|
|
||||||
|
o [GH#1112] Resolved crash opportunities caused by unexpected libpcap version
|
||||||
|
string format. [Gisle Vanem, nnposter]
|
||||||
|
|
||||||
o [NSE][GH#1083] New set of Telnet softmatches for version detection based on
|
o [NSE][GH#1083] New set of Telnet softmatches for version detection based on
|
||||||
Telnet DO/DON'T options offered, covering a wide variety of devices and
|
Telnet DO/DON'T options offered, covering a wide variety of devices and
|
||||||
operating systems. [D Roberson]
|
operating systems. [D Roberson]
|
||||||
|
|||||||
9
nmap.cc
9
nmap.cc
@@ -2749,11 +2749,10 @@ static void display_nmap_version() {
|
|||||||
|
|
||||||
const char *pcap_version = pcap_lib_version();
|
const char *pcap_version = pcap_lib_version();
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
const char *pcap_num = strstr(pcap_version, "version ");
|
const char *pcap_num = strpbrk(pcap_version, "0123456789");
|
||||||
if (pcap_num) {
|
if (pcap_num == NULL)
|
||||||
pcap_num += strlen("version ");
|
pcap_num = "(unknown)";
|
||||||
}
|
std::string pcap_num_str (pcap_num, strcspn(pcap_num, ","));
|
||||||
std::string pcap_num_str (pcap_num, strchr(pcap_num, ',') - pcap_num);
|
|
||||||
#else
|
#else
|
||||||
std::string pcap_num_str = get_word_or_quote(pcap_version, 2);
|
std::string pcap_num_str = get_word_or_quote(pcap_version, 2);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user