Bug 182198 - server writing to read-only string constants
Summary: server writing to read-only string constants
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: 389
Classification: Retired
Component: Directory Server
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Orla Hegarty
URL:
Whiteboard: 1.0.2
Depends On: 182201
Blocks: 183369
TreeView+ depends on / blocked
 
Reported: 2006-02-20 22:53 UTC by Rich Megginson
Modified: 2007-04-18 17:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-10 23:04:09 UTC
Embargoed:


Attachments (Terms of Use)

Description Rich Megginson 2006-02-20 22:53:27 UTC
views.c and windows_protocol_util.c use slapi_str2filter() with a constant
string argument, but that function writes to its argument.

Comment 1 Rich Megginson 2006-02-20 22:59:35 UTC
Cannot pass const strings into slapi_str2filter, since it can modify
the contents.  I'm not sure why we haven't caught this earlier, but
I believe it has something to do with the patch to make ds build on
Fedora Core 4 with gcc4.  To do that, we turn off the -fwriteable-strings
argument to gcc.  I suppose with it on, it moves those strings to
some sort of writeable memory location.  With it off, constant strings
are definitely in the data section.  There was one place in views that
used a constant string, and a couple of places in the windows sync code.

/cvs/dirsec/ldapserver/ldap/servers/plugins/views/views.c,v
revision 1.7
+++ views.c	22 Nov 2005 03:40:14 -0000	1.7

/cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
revision 1.23
+++ windows_protocol_util.c	22 Nov 2005 03:40:08 -0000	1.23


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