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; }