Nmap Development mailing list archives

Re: Bringing CPE to NSE


From: David Fifield <david () bamsoftware com>
Date: Thu, 12 Jan 2012 19:36:13 -0800

On Thu, Jan 12, 2012 at 06:20:19PM +0100, Henri Doreau wrote:
Hello David,

thanks a lot for testing. I did some more investigations about the
leak and finally managed to fix it, I think. Actually my patch keeps
MatchDetails untouched and even better, it doesn't introduce the leak:
I can reproduce it without the patch using the memleak.nse script
attached.

The port->service structure wasn't free()'d in
PortList::setServiceProbeResults(). I've added the free() statements
to my patch (attached).

I'm sorry, I don't know what I was thinking. Yes, of course, your
original patch didn't touch MatchDetails; I don't know what gave me that
impression.

Thanks for finding the leak. Please go ahead and commit this. And would
you add a short section to docs/scripting.xml describing the new table?
It's the section that starts like this:

    <sect2 id="nse-api-arguments">
      <title>Information Passed to a Script</title>

Just add a new varlistentry like this:

          <varlistentry>
            <term><option>host.cpe</option></term>
            <listitem>
              <para>
              ...
              </para>
            </listitem>
          </varlistentry>

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


Current thread: