mirror of
https://github.com/nmap/nmap.git
synced 2026-01-02 12:59:02 +00:00
merge soc07 r4939 - fixed a small bug in formatscriptoutput (output.cc) which caused a core dump
This commit is contained in:
@@ -466,6 +466,8 @@ int process_preparerunlevels(std::list<struct thread_record> torun_threads) {
|
||||
if(runlevel_idx < (*runlevel_iter).runlevel) {
|
||||
runlevel_idx = (*runlevel_iter).runlevel;
|
||||
current_runlevel.clear();
|
||||
//push_back an empty in which we store all scripts of the current
|
||||
//runlevel...
|
||||
torun_scripts.push_back(current_runlevel);
|
||||
}
|
||||
|
||||
|
||||
@@ -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