Bug 181776 - 64bit issues with normalize_path(), make_dn(), and add_aci_v()
64bit issues with normalize_path(), make_dn(), and add_aci_v()
Product: 389
Classification: Community
Component: Directory Server (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Rich Megginson
Viktor Ashirov
Depends On:
Blocks: 183369
  Show dependency treegraph
Reported: 2006-02-16 09:48 EST by Rich Megginson
Modified: 2015-12-07 11:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-12-07 11:58:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
list of files for fix (74 bytes, text/plain)
2006-02-16 09:48 EST, Rich Megginson
no flags Details
diffs for fix (9.93 KB, text/plain)
2006-02-16 09:49 EST, Rich Megginson
no flags Details

  None (edit)
Description Rich Megginson 2006-02-16 09:48:08 EST
1) normalize_path() does not allocate space for the char* array correctly.  It
should use slapi_ch_calloc with an elemsize of sizeof(char *) instead of 1.  I
guess we got lucky on 32 bit platforms where strlen(path) > (num dirs + 1) * 4.
 However, on a 64 bit platform, the 4 becomes an 8 and core dumps ensue.
2) make_dn() and add_aci_v() in cfg_sspt.c use a null terminated varargs list. 
The null terminator is a bare 0 which the gcc3 compiler assumes is an int.  This
blows up the varargs function where the 32bit 0 is cast to a 64bit char * with
garbage in it.
Comment 1 Rich Megginson 2006-02-16 09:48:09 EST
Created attachment 124749 [details]
list of files for fix
Comment 2 Rich Megginson 2006-02-16 09:49:04 EST
Created attachment 124750 [details]
diffs for fix
Comment 3 Rich Megginson 2006-02-16 12:35:45 EST
Reviewed by: Nathan and Noriko (Thanks!)
Files: https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=124749
Branch: HEAD
Fix Description: 1) use sizeof(char *) as the elemsize to pass to 
slapi_ch_calloc(). 2) create a variable const char *NULLSTR = 0 to pass 
as the last argument to the varargs functions.
Platforms tested: RHEL4 64
Flag Day: no
Doc impact: no

Checking in ldapserver/ldap/admin/src/cfg_sspt.c;
/cvs/dirsec/ldapserver/ldap/admin/src/cfg_sspt.c,v  <--  cfg_sspt.c
new revision: 1.8; previous revision: 1.7
Checking in ldapserver/ldap/servers/slapd/util.c;
/cvs/dirsec/ldapserver/ldap/servers/slapd/util.c,v  <--  util.c
new revision: 1.10; previous revision: 1.9

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