Red Hat Bugzilla – Bug 182198
server writing to read-only string constants
Last modified: 2007-04-18 13:38:13 EDT
views.c and windows_protocol_util.c use slapi_str2filter() with a constant
string argument, but that function writes to its argument.
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.
+++ views.c 22 Nov 2005 03:40:14 -0000 1.7
+++ windows_protocol_util.c 22 Nov 2005 03:40:08 -0000 1.23