Bug 245396 - adminutil: retrieveISIEs returns bogus data
Summary: adminutil: retrieveISIEs returns bogus data
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Admin
Version: 1.1.0beta
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard:
Depends On:
Blocks: 240316 245369 FDS1.1.0
TreeView+ depends on / blocked
 
Reported: 2007-06-22 20:15 UTC by Rich Megginson
Modified: 2015-12-07 16:55 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:55:56 UTC
Embargoed:


Attachments (Terms of Use)
diffs (7.17 KB, patch)
2007-06-22 20:15 UTC, Rich Megginson
no flags Details | Diff
cvs commit log (1.77 KB, text/plain)
2007-06-22 21:07 UTC, Rich Megginson
no flags Details

Description Rich Megginson 2007-06-22 20:15:36 UTC
The retrieveISIEs function returns the correct productIDs but the productDNs are
bogus - they look like random memory addresses.

Comment 1 Rich Megginson 2007-06-22 20:15:36 UTC
Created attachment 157645 [details]
diffs

Comment 2 Rich Megginson 2007-06-22 21:07:20 UTC
Created attachment 157651 [details]
cvs commit log

Reviewed by: nkinder (Thanks!)
Fix Description: retrieveISIEs creates a list of id + DN pairs using
the ListNodePtr interface.  Each node has a name (the id) and a value
(a char ** with the DN as the first char *) and forms a linked list of
all of the values.  It then flattens the list into an array of name/value
pairs for returning.  However, instead of passing val[0] to the
addSingleValueAttribute() function for the value, it was passing val cast
to a (char *), which is entirely bogus.
The fix is to pass in ((char**)node->val)[0] which is a char * value.  Yet
another lesson in why void * is bad, and why you should not defeat the
compiler's type checker . . .
I also fixed another minor mem leak, and added @nss_inc@ to the list of include
directories - I guess it works because pkg-config mozldap[6] always returns the

nss include directory in its output . . .
Platforms tested: RHEL4
Flag day: Yes - autotool file changes

Comment 3 Rich Megginson 2008-01-03 20:53:04 UTC
VERIFIED - no leaks or errors seen with valgrind on RHEL5 x86_64


Note You need to log in before you can comment on or make changes to this bug.