From e7ff956638780dc1c6f160a1fd041b92cebff9ac Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 15 Mar 2010 23:46:36 +0200 Subject: [PATCH] common: xf86Configure: alloc_strlen: Allocated memory does not have space for the terminating NUL of the string buffer_alloc: Called allocating function "realloc" which allocated memory dictated by parameter "len + strlen(displaySize_string)" alloc_strlen: Allocated memory does not have space for the terminating NUL of the string var_assign: Assigned "ptr->mon_comment" to storage allocated by "realloc(ptr->mon_comment, len + strlen(displaySize_string))" Signed-off-by: Oliver McFadden Reviewed-by: Matt Turner Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Configure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c index d74d90bdd..67bf08bbf 100644 --- a/hw/xfree86/common/xf86Configure.c +++ b/hw/xfree86/common/xf86Configure.c @@ -612,7 +612,7 @@ configureDDCMonitorSection (int screennum) len = 0; } if ((ptr->mon_comment = - realloc(ptr->mon_comment, len+strlen(displaySize_string)))) { + realloc(ptr->mon_comment, len + strlen(displaySize_string) + 1))) { strcpy(ptr->mon_comment + len, displaySize_string); } }