Bug 181776 - 64bit issues with normalize_path(), make_dn(), and add_aci_v()
Summary: 64bit issues with normalize_path(), make_dn(), and add_aci_v()
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.0
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Viktor Ashirov
URL:
Whiteboard: 1.0.2
Depends On:
Blocks: 183369
TreeView+ depends on / blocked
 
Reported: 2006-02-16 14:48 UTC by Rich Megginson
Modified: 2015-12-07 16:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-12-07 16:58:36 UTC
Embargoed:


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

Description Rich Megginson 2006-02-16 14:48:08 UTC
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 14:48:09 UTC
Created attachment 124749 [details]
list of files for fix

Comment 2 Rich Megginson 2006-02-16 14:49:04 UTC
Created attachment 124750 [details]
diffs for fix

Comment 3 Rich Megginson 2006-02-16 17:35:45 UTC
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
done
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
done



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