Skip to content

Crash in display_nmap_version() #1112

@gvanem

Description

@gvanem

A simple nmap -V could cause a crash in display_nmap_version(). The reason seems to be this piece of pcap-version code:

#ifdef WIN32
  const char *pcap_num = strstr(pcap_version, "version ");
  if (pcap_num) {
    pcap_num += strlen("version ");
  }
  std::string pcap_num_str (pcap_num, strchr(pcap_num, ',') - pcap_num);

When there's no comma after pcap_num, it tries to push_back an almost infinite string!
When building with the internal Nmap libpcap, this does not happen. But when using the official libpcap, it does. Blame the horrid WIN32 code in pcap_lib_version().

(For me, it's no longer possible to build using MSVC-2017 and the internal libpcap).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions