summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2011-03-08 16:09:49 +0100
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-03-09 15:51:29 -0800
commitfe2cf6e2b70e57624aad71f510ff8c6addaae196 (patch)
treeb9824e9ee6bf4e9b64f4853726caf330157b4761
parentf6c791b5f318d8805db4cb6c74b1bc2e91d6c15c (diff)
XtAsprintf: Fix memory corruption.
Don't write the null terminator to a random place, this can trigger some segfault in XtOpenDisplay() and other annoyances. Debian Bug #617208 <http://bugs.debian.org/617208> Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/Alloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Alloc.c b/src/Alloc.c
index 67413ab..be643a8 100644
--- a/src/Alloc.c
+++ b/src/Alloc.c
@@ -147,7 +147,7 @@ Cardinal XtAsprintf(
if (len < sizeof(buf))
{
strncpy(*new_string, buf, len);
- new_string[len] = '\0';
+ (*new_string)[len] = '\0';
}
else
{