mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
xwin: fix possibly missing string termination
../hw/xwin/InitOutput.c: In function ‘winFixupPaths’:
747../hw/xwin/InitOutput.c:578:9: warning: ‘strncpy’ output truncated before terminating nul copying 5 bytes from a string of the same length [-Wstringop-truncation]
748 578 | strncpy(buffer, "HOME=", 5);
749 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1295>
(cherry picked from commit 123a473e33)
This commit is contained in:
committed by
Alan Coopersmith
parent
82896e25a6
commit
3c6b8a5e84
@@ -577,9 +577,9 @@ winFixupPaths(void)
|
||||
putenv(buffer);
|
||||
}
|
||||
if (getenv("HOME") == NULL) {
|
||||
char buffer[MAX_PATH + 5];
|
||||
char buffer[MAX_PATH + 5] = {0};
|
||||
|
||||
strncpy(buffer, "HOME=", 5);
|
||||
strncpy(buffer, "HOME=", 6);
|
||||
|
||||
/* query appdata directory */
|
||||
if (SHGetFolderPathA
|
||||
|
||||
Reference in New Issue
Block a user