mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-06-05 03:01:43 -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;
|
if (*l != '=') continue;
|
||||||
l++;
|
l++;
|
||||||
while (*l == ' ') l++;
|
while (*l == ' ') l++;
|
||||||
result = malloc (strlen (l));
|
result = malloc (strlen (l) + 1);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
r = result;
|
r = result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue