mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
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>
This commit is contained in:
parent
b41dc10063
commit
0201708773
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue