Nmap Development mailing list archives
Re: [NSE] bug stdnse.output_table
From: Patrik Karlsson <patrik () cqure net>
Date: Thu, 20 Sep 2012 18:14:01 +0200
On Thu, Sep 20, 2012 at 8:48 AM, David Fifield <david () bamsoftware com>wrote:
On Tue, Sep 18, 2012 at 01:31:35PM -0700, David Fifield wrote:On Sun, Sep 16, 2012 at 10:18:29AM +0200, Patrik Karlsson wrote:I'm having problems removing items from the output_table by assigningthema nil value. What happens is that some are removed others are returned as "nil" intheoutput. Not sure what's going on here, but thought I would post it here to seeifit's obvious to someone, before I dig in and try to make sense of it. The attached script can be used to reproduce.I see this problem too. I think the bug is that the order array is not updated to match the reverse array. order and reverse are supposed to be inverses of each other, e.g., order {1=A,2=B,3=C,4=D} reverse {A=1,B=2,C=3,D=4} table.remove(order, reverse["A"]) shifts the elements of order by 1, and reverse["A"] is subsequently deleted, but the other elements of reverse are not shifted to match: order {1=B,2=C,3=D} reverse {B=3,C=3,D=4} I think we should ditch reverse and just do a linear search for the key in the order array. (Or reverse can become a boolean true/false membership cache, instead of a mapping to indices.)I think this is fixed in r29837. David Fifield
That did it for me. Thanks, Patrik -- Patrik Karlsson http://www.cqure.net http://twitter.com/nevdull77 _______________________________________________ Sent through the nmap-dev mailing list http://cgi.insecure.org/mailman/listinfo/nmap-dev Archived at http://seclists.org/nmap-dev/
Current thread:
- [NSE] bug stdnse.output_table Patrik Karlsson (Sep 16)
- Re: [NSE] bug stdnse.output_table David Fifield (Sep 18)
- Re: [NSE] bug stdnse.output_table David Fifield (Sep 19)
- Re: [NSE] bug stdnse.output_table Patrik Karlsson (Sep 20)
- Re: [NSE] bug stdnse.output_table David Fifield (Sep 19)
- Re: [NSE] bug stdnse.output_table David Fifield (Sep 18)