mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-08 14:35:59 +01:00
Revert "xcursor: use strncat instead of strncpy"
This reverts commit 7dffe9339b
, which introduced
another linter error with -O3:
error: ‘strncat’ specified bound 7 equals source length [-Werror=stringop-overflow=]
This makes sense because strncat(dest, "cursors", strlen("cursors")) is moot
in security point of view.
The next commit will replace strncpy() with memcpy(), so let's restore the
original implementation.
This commit is contained in:
parent
b36af22c94
commit
a71d565138
1 changed files with 5 additions and 1 deletions
|
@ -655,7 +655,11 @@ _XcursorAddPathElt (char *path, const char *elt, int len)
|
|||
elt++;
|
||||
len--;
|
||||
}
|
||||
strncat (path + pathlen, elt, len);
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
strncpy (path + pathlen, elt, len);
|
||||
path[pathlen + len] = '\0';
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
Loading…
Reference in a new issue