From fe2cf6e2b70e57624aad71f510ff8c6addaae196 Mon Sep 17 00:00:00 2001 From: Cyril Brulebois Date: Tue, 8 Mar 2011 16:09:49 +0100 Subject: 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 Signed-off-by: Cyril Brulebois Reviewed-by: Alan Coopersmith Signed-off-by: Alan Coopersmith --- src/Alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { -- cgit v1.2.3