From 020170877332f828aaf639ebe5c56d3ff6444511 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 9 Oct 2012 18:46:21 +0100 Subject: xcursor: Fix allocation based on string length strlen() doesn't include the terminating NUL. Therefore when allocating a block of memory to hold something equivalent to the length of the string we must increment to take the NUL byte into consideration. Signed-off-by: Rob Bradford --- cursor/xcursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cursor') diff --git a/cursor/xcursor.c b/cursor/xcursor.c index 1f66bce..7a9662a 100644 --- a/cursor/xcursor.c +++ b/cursor/xcursor.c @@ -757,7 +757,7 @@ _XcursorThemeInherits (const char *full) if (*l != '=') continue; l++; while (*l == ' ') l++; - result = malloc (strlen (l)); + result = malloc (strlen (l) + 1); if (result) { r = result; -- cgit v1.2.3