Nmap Development mailing list archives

bugfix: "uninitialized UserArray/PassArray"


From: Robin Krom <kromr () student ethz ch>
Date: Fri, 18 Jun 2010 00:02:01 +0100

Hi,
I think there's a minor bug in ncrack revision 18218 that causes ncrack to throw the
fatal error "uninitialized UserArray/PassArray" and shutdown. 

the bug is in the lines 2061 - 2064 of ncrack.cc:

  if (SG->last_accessed == SG->services_active.end()) 
    li = SG->services_active.begin();
  else 
    li = SG->last_accessed++;

here SG->last_accessed is checked wether it points to the end of the
list SG->services_active. however, if it points to the element exactly
before the end, the iterator li will be assigned with
SG->last_accessed++, and thus li will point to the end of the list. li
is not checked further afterwards.

furthermore i want to note, that SG->last_accessed often does not point at the
element last accessed but at the element in SG->services_active
following the element last accessed. the reason for this is that during
ncrack_probes() SG->pushServiceToList() is called which in turn calls
std::list::erase() and this returns an iterator that points to the
element in the list following the erased element. 

i corrected this issues in the appended patches. let me know what
you think.

Cheers,
Robin

Attachment: ncrack.cc.patch
Description:

Attachment: ServiceGroup.h.patch
Description:

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

Current thread: