mirror of
https://github.com/nmap/nmap.git
synced 2026-08-03 22:29:06 +00:00
merge soc07 r4939 - fixed a small bug in formatscriptoutput (output.cc) which caused a core dump
This commit is contained in:
parent
b02117546f
commit
65e680a634
2 changed files with 5 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue