mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
merge soc07 r4994:5001 - Adding <portused> element for the open TCP port used when performing OS Detection. Only closed TCP and UDP were being printed; I guess it was just an oversight; Call endTask() in process_mainloop() in nse_main.cc so task ending information (like the <taskend> element) are printed; old_locale is allocated on the STACK not the HEAP; NULL is NOT a valid PCRE pointer.
This commit is contained in:
parent
c2e69defae
commit
a09a6e2007
3 changed files with 8 additions and 2 deletions
|
|
@ -279,6 +279,8 @@ int process_mainloop(lua_State* l) {
|
|||
}
|
||||
}
|
||||
|
||||
progress.endTask(NULL, NULL);
|
||||
|
||||
return SCRIPT_ENGINE_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ static const unsigned char *Lpcre_maketables(lua_State *L, int stackpos)
|
|||
tables = pcre_maketables(); /* make tables with new locale */
|
||||
(void)setlocale(LC_CTYPE, old_locale); /* restore the old locale */
|
||||
|
||||
free(old_locale);
|
||||
free(locale);
|
||||
return tables;
|
||||
}
|
||||
|
|
@ -158,7 +157,7 @@ static void Lpcre_getargs(lua_State *L, pcre2 **pud, const char **text,
|
|||
size_t *text_len)
|
||||
{
|
||||
*pud = (pcre2 *)luaL_checkudata(L, 1, pcre_handle);
|
||||
if(*pud != NULL)
|
||||
if(*pud == NULL)
|
||||
(void)luaL_argerror(L, 1, ("compiled regexp expected"));
|
||||
*text = luaL_checklstring(L, 2, text_len);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1409,6 +1409,11 @@ void printosscanoutput(Target *currenths) {
|
|||
distance = currenths->distance;
|
||||
|
||||
log_write(LOG_XML, "<os>");
|
||||
if (FPR->osscan_opentcpport > 0) {
|
||||
log_write(LOG_XML,
|
||||
"<portused state=\"open\" proto=\"tcp\" portid=\"%hu\" />\n",
|
||||
FPR->osscan_opentcpport);
|
||||
}
|
||||
if (FPR->osscan_closedtcpport > 0) {
|
||||
log_write(LOG_XML,
|
||||
"<portused state=\"closed\" proto=\"tcp\" portid=\"%hu\" />\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue