From c14f810067bceaf2be16b22710a390976578c0d0 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Sat, 28 Dec 2013 11:11:26 -0500 Subject: [PATCH] qrexec-agent: pass an int pointer to sscanf to match %d and check for 16 bit unsigned range after that. --- qrexec/qrexec-agent.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qrexec/qrexec-agent.c b/qrexec/qrexec-agent.c index be63963..408099e 100644 --- a/qrexec/qrexec-agent.c +++ b/qrexec/qrexec-agent.c @@ -84,7 +84,7 @@ void init() void wake_meminfo_writer() { FILE *f; - pid_t pid; + int pid; if (meminfo_write_started) /* wake meminfo-writer only once */ @@ -101,6 +101,10 @@ void wake_meminfo_writer() { } fclose(f); + if (pid <= 1 || pid > 0xffff) { + /* check within acceptable range */ + return; + } kill(pid, SIGUSR1); meminfo_write_started = 1; }