mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
strncpy's third argument should be the length of the dest buffer, not the source.
This commit is contained in:
committed by
Carlos R. Mafra
parent
a7baed6cf7
commit
d9bc96e497
@@ -1006,9 +1006,9 @@ static void handleClientMessage(XEvent * event)
|
|||||||
char *command;
|
char *command;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
len = sizeof(event->xclient.data.b) + 1;
|
len = sizeof(event->xclient.data.b);
|
||||||
command = wmalloc(len);
|
command = wmalloc(len + 1);
|
||||||
strncpy(command, event->xclient.data.b, sizeof(event->xclient.data.b));
|
strncpy(command, event->xclient.data.b, len);
|
||||||
|
|
||||||
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
|
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
|
||||||
wwarning(_("Got Reconfigure command"));
|
wwarning(_("Got Reconfigure command"));
|
||||||
|
|||||||
Reference in New Issue
Block a user