mirror of
https://github.com/nmap/nmap.git
synced 2025-12-25 17:09:02 +00:00
merge soc07 r4939 - fixed a small bug in formatscriptoutput (output.cc) which caused a core dump
This commit is contained in:
@@ -779,8 +779,9 @@ char* formatScriptOutput(struct script_scan_result ssr) {
|
||||
|
||||
// delete the unwanted trailing newline
|
||||
pos = result.rfind(sep);
|
||||
result.erase(pos, strlen(sep));
|
||||
|
||||
if(pos!=std::string::npos){
|
||||
result.erase(pos, strlen(sep));
|
||||
}
|
||||
c_result = strdup(result.c_str());
|
||||
|
||||
return c_result;
|
||||
|
||||
Reference in New Issue
Block a user