mirror of
https://github.com/nmap/nmap.git
synced 2025-12-09 14:11:29 +00:00
Fix segfault when using service name wildcards with -p.
This commit is contained in:
@@ -132,14 +132,14 @@ static int nmap_protocols_init() {
|
|||||||
/* Now we make sure our protocols don't have duplicates */
|
/* Now we make sure our protocols don't have duplicates */
|
||||||
if (!status.second) {
|
if (!status.second) {
|
||||||
if (o.debugging > 1) {
|
if (o.debugging > 1) {
|
||||||
error("Protocol %d (%s) has duplicate number (%d) in protocols file %s", status.first->second.p_proto, ent.p_name, protno, filename);
|
error("Protocol %hu (%s) has duplicate number (%hu) in protocols file %s", status.first->second.p_proto, ent.p_name, protno, filename);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (protocol_table[protno]) {
|
if (protocol_table[protno]) {
|
||||||
if (o.debugging > 1) {
|
if (o.debugging > 1) {
|
||||||
error("Protocol %d (%s) has duplicate name (%s) in protocols file %s", protno, protocol_table[protno]->p_name, ent.p_name, filename);
|
error("Protocol %hu (%s) has duplicate name (%s) in protocols file %s", protno, protocol_table[protno]->p_name, ent.p_name, filename);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
struct nprotoent {
|
struct nprotoent {
|
||||||
const char *p_name;
|
const char *p_name;
|
||||||
short p_proto;
|
u16 p_proto;
|
||||||
};
|
};
|
||||||
|
|
||||||
int addprotocolsfromservmask(char *mask, u8 *porttbl);
|
int addprotocolsfromservmask(char *mask, u8 *porttbl);
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
struct nservent {
|
struct nservent {
|
||||||
const char *s_name;
|
const char *s_name;
|
||||||
const char *s_proto;
|
const char *s_proto;
|
||||||
short s_port;
|
u16 s_port;
|
||||||
};
|
};
|
||||||
|
|
||||||
int addportsfromservmask(const char *mask, u8 *porttbl, int range_type);
|
int addportsfromservmask(const char *mask, u8 *porttbl, int range_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user