Repository : ssh://git@diktynna/alfred
On branch : master
commit eec40c3bb65e384b556e10b4cdc8f6c2b02b12bc Author: Sven Eckelmann sven@narfation.org Date: Tue Feb 22 00:31:47 2022 +0100
alfred: Check server_status type before parsing packet
It might be that the server didn't respond with the correct type for ALFRED_SERVER_STATUS. So just check it before parsing it.
Fixes: 5a7d28b1866d ("alfred: introduce 'server status' IPC call") Signed-off-by: Sven Eckelmann sven@narfation.org
eec40c3bb65e384b556e10b4cdc8f6c2b02b12bc client.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/client.c b/client.c index bbe29ee..81cdd7c 100644 --- a/client.c +++ b/client.c @@ -373,6 +373,11 @@ int alfred_client_server_status(struct globals *globals) goto err; }
+ if (status_rep->header.type != ALFRED_SERVER_STATUS) { + perror("alfred server_status type mismatch"); + goto err; + } + if (status_rep->header.version != ALFRED_VERSION) { perror("alfred version mismatch"); goto err;