mirror of
https://github.com/gryf/wmaker.git
synced 2026-10-06 09:20:34 +02:00
Fix buffer overflow in SendHelperMessage()
The following fixes a buffer overflow in SendHelperMessage() which i started seeing recently on x64.
This commit is contained in:
1 parent
38074e7bd5
commit
e2b6a85e80
1 file changed
+1
-1
+1
-1
@@ -1139,7 +1139,7 @@ SendHelperMessage(WScreen *scr, char type, int workspace, char *msg)
|
||||
|
||||
len = (msg ? strlen(msg) : 0) + (workspace >=0 ? 4 : 0) + 1 ;
|
||||
buffer = wmalloc(len+5);
|
||||
snprintf(buf, len, "%4i", len);
|
||||
snprintf(buf, sizeof(buf), "%4i", len);
|
||||
memcpy(buffer, buf, 4);
|
||||
buffer[4] = type;
|
||||
i = 5;
|
||||
|
||||
Reference in new issue
Block a user