1
0
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:
fyodor
2007-08-11 04:25:05 +00:00
parent b02117546f
commit 65e680a634
2 changed files with 5 additions and 2 deletions

View File

@@ -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;