diff options
author | Rob Bradford <rob@linux.intel.com> | 2012-10-09 18:46:21 +0100 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-10-09 23:01:23 -0400 |
commit | 020170877332f828aaf639ebe5c56d3ff6444511 (patch) | |
tree | 6e7943fdf87281f3690d3850ca59254384b3f203 /cursor | |
parent | b41dc10063d5b8e2a10e49ca8b227e5f5338ca75 (diff) |
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 <rob@linux.intel.com>
Diffstat (limited to 'cursor')
-rw-r--r-- | cursor/xcursor.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |