mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
Fix possible missing NUL at end of string
There are were a few uses of 'strncpy' that could lead to a missing NUL, resulting in possible garbage being displayed. As suggested by Tamas, use 'wstrlcpy' instead
This commit is contained in:
committed by
Carlos R. Mafra
parent
e499f31a4e
commit
e01d14abe4
@@ -157,9 +157,9 @@ static WUserMenuData *convertShortcuts(WScreen * scr, WMPropList * shortcut)
|
||||
for (i = 0, j = 0; i < keycount; i++) {
|
||||
data->key[j].modifier = 0;
|
||||
if (WMIsPLArray(shortcut)) {
|
||||
strncpy(buf, WMGetFromPLString(WMGetFromPLArray(shortcut, i)), MAX_SHORTCUT_LENGTH);
|
||||
wstrlcpy(buf, WMGetFromPLString(WMGetFromPLArray(shortcut, i)), MAX_SHORTCUT_LENGTH);
|
||||
} else {
|
||||
strncpy(buf, WMGetFromPLString(shortcut), MAX_SHORTCUT_LENGTH);
|
||||
wstrlcpy(buf, WMGetFromPLString(shortcut), MAX_SHORTCUT_LENGTH);
|
||||
}
|
||||
b = (char *)buf;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user