projects
/
platform
/
upstream
/
wayland.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b41dc10
)
xcursor: Fix allocation based on string length
author
Rob Bradford
<rob@linux.intel.com>
Tue, 9 Oct 2012 17:46:21 +0000
(18:46 +0100)
committer
Kristian Høgsberg
<krh@bitplanet.net>
Wed, 10 Oct 2012 03:01:23 +0000
(23:01 -0400)
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>
cursor/xcursor.c
patch
|
blob
|
history
diff --git
a/cursor/xcursor.c
b/cursor/xcursor.c
index
1f66bce
..
7a9662a
100644
(file)
--- 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;