mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 05:09:02 +00:00
Compare string contents, not pointer values.
This bug was introduced in r30334. We want to compare the contents of the strings, not their addresses. This bug caused host script results to be printed in arbitrary, perhaps not even well-defined, order.
This commit is contained in:
@@ -451,7 +451,7 @@ std::string protect_xml(const std::string s) {
|
||||
/* This is a helper function to determine the ordering of the script results
|
||||
based on their id. */
|
||||
static bool scriptid_lessthan(ScriptResult a, ScriptResult b) {
|
||||
return a.get_id() < b.get_id();
|
||||
return strcmp(a.get_id(), b.get_id()) < 0;
|
||||
}
|
||||
|
||||
static char *formatScriptOutput(ScriptResult sr) {
|
||||
|
||||
Reference in New Issue
Block a user