Nmap Development mailing list archives

Re: --script-updatedb causes unhandled exception


From: "Patrick Donnelly" <batrick.donnelly () gmail com>
Date: Sat, 26 Jul 2008 20:57:09 -0600

Hi Jah,

On Sat, Jul 26, 2008 at 9:22 AM, jah <jah () zadkiel plus com> wrote:
Hello,

I crashed nmap trying to update scripts/script.db.
I noticed, whilst stepping through a debug build, that between opening
and closing script.db, nothing was being written to it.  The following
loop was never entered for each script processed:

while (lua_next(L, -2) != 0)
     {
       lua_pushvalue(L, -3); // string.lower
       lua_insert(L, -2); // put below category string
       lua_call(L, 1, 1); // lowered string on stack
       fprintf(scriptdb, "Entry{ category = \"%s\", filename = \"%s\" }\n",
           lua_tostring(L, -1), filebase);
       lua_pop(L, 1);
     }

Hence, nothing to write to the db.

I tried   while (lua_next(L, -3) != 0)   and this seems to fix that
issue and results in a proper script.db.

I've attached a patch, but I'm not sure whether it is the proper fix...

Your patch is correct and I have applied it.

Thanks,

-- 
-Patrick Donnelly

"One of the lessons of history is that nothing is often a good thing
to do and always a clever thing to say."

-Will Durant

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: