summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver McFadden <oliver.mcfadden@nokia.com>2010-03-15 23:46:36 +0200
committerKeith Packard <keithp@keithp.com>2010-03-21 15:20:53 -0700
commite7ff956638780dc1c6f160a1fd041b92cebff9ac (patch)
treea991e90edb50032374b6b2eab8e059dbdad2f569
parentaeae6637b52b042cf8b07c6943abcd5d31968d49 (diff)
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 <oliver.mcfadden@nokia.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/common/xf86Configure.c2
1 files changed, 1 insertions, 1 deletions
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);
}
}