void-packages/srcpkgs/bspwm/patches/fix-possible-buffer-overflo...

15 lines
615 B
Diff

Patch backported from: https://github.com/baskerville/bspwm/commit/ab81f1b10148311d0b798f96d472d4afcbb77ce5
--- src/bspwm.c.orig 2018-12-30 21:34:53.329062706 -0600
+++ src/bspwm.c 2018-12-30 21:36:16.149061038 -0600
@@ -163,8 +163,8 @@
if (FD_ISSET(sock_fd, &descriptors)) {
cli_fd = accept(sock_fd, NULL, 0);
- if (cli_fd > 0 && (n = recv(cli_fd, msg, sizeof(msg), 0)) > 0) {
- msg[n] = '\0';
+ if (cli_fd > 0 && (n = recv(cli_fd, msg, sizeof(msg)-1, 0)) > 0) {
+ msg[n] = '\0';
FILE *rsp = fdopen(cli_fd, "w");
if (rsp != NULL) {
handle_message(msg, n, rsp);