mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 07:02:30 +01:00
WPrefs: fix possible buffer overrun (Coverity #50216)
As pointed by Coverity, if the Keysym name is very long and many modifiers are used, the function 'capture_shortcut' could overflow its internal buffer. As the case is very unlikely to appear, do not increase the size of the internal buffer (it seems to be already well sized, and we have no know maximum size for a Keysym name), just use the appropriate function to append the name at the end. Signed-off-by: Christophe CURIS <christophe.curis@free.fr> Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
committed by
Carlos R. Mafra
parent
8c1f59a40f
commit
d1e1521a88
@@ -356,7 +356,7 @@ char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case)
|
||||
if ((numlock_mask != Mod5Mask) && (ev.xkey.state & Mod5Mask))
|
||||
strcat(buffer, "Mod5+");
|
||||
|
||||
strcat(buffer, key);
|
||||
wstrlcat(buffer, key, sizeof(buffer));
|
||||
|
||||
return wstrdup(buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user