mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-25 08:32:30 +00: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
@ -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 New Issue
Block a user