From bd00810072076d400afd82d35f6f3378c579924d Mon Sep 17 00:00:00 2001 From: jcorporation Date: Mon, 18 Jun 2018 22:24:35 +0100 Subject: [PATCH] Fixed buffer overflow in notify callback. Occurs only if multiple clients are connected. --- src/mpd_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpd_client.c b/src/mpd_client.c index 1a25e97..0b6b868 100644 --- a/src/mpd_client.c +++ b/src/mpd_client.c @@ -372,7 +372,7 @@ static int mympd_notify_callback(struct mg_connection *c, const char *param) { #ifdef DEBUG fprintf(stdout,"Notify: %s\n",mpd.buf); #endif - mg_send_websocket_frame(c, WEBSOCKET_OP_TEXT, mpd.buf, mpd.buf_size); + mg_send_websocket_frame(c, WEBSOCKET_OP_TEXT, mpd.buf, strlen(mpd.buf)); if(s->song_id != mpd.song_id) {