1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-18 20:10:29 +01:00

strncpy's third argument should be the length of the dest buffer, not the source.

This commit is contained in:
Jeremy Sowden
2019-07-12 23:28:14 +01:00
committed by Carlos R. Mafra
parent a7baed6cf7
commit d9bc96e497

View File

@@ -1006,9 +1006,9 @@ static void handleClientMessage(XEvent * event)
char *command;
size_t len;
len = sizeof(event->xclient.data.b) + 1;
command = wmalloc(len);
strncpy(command, event->xclient.data.b, sizeof(event->xclient.data.b));
len = sizeof(event->xclient.data.b);
command = wmalloc(len + 1);
strncpy(command, event->xclient.data.b, len);
if (strncmp(command, "Reconfigure", sizeof("Reconfigure")) == 0) {
wwarning(_("Got Reconfigure command"));