diff options
author | Leah Neukirchen <leah@vuxu.org> | 2023-12-22 23:26:11 +0100 |
---|---|---|
committer | Leah Neukirchen <leah@vuxu.org> | 2023-12-23 00:31:15 +0100 |
commit | 4310bc5147f667572560a7b2b9e982fe0f250d9d (patch) | |
tree | 0f15c803dff1eed65dc798faf23fc78fa80bb8ff | |
parent | de7c7af8e78bd4913f43615828ecf7c81088c7af (diff) | |
download | nitro-4310bc5147f667572560a7b2b9e982fe0f250d9d.tar.gz nitro-4310bc5147f667572560a7b2b9e982fe0f250d9d.tar.xz nitro-4310bc5147f667572560a7b2b9e982fe0f250d9d.zip |
don't generate replies if we can't reply
-rw-r--r-- | nitro.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nitro.c b/nitro.c index 73927ee..118e836 100644 --- a/nitro.c +++ b/nitro.c @@ -775,6 +775,9 @@ handle_control_sock() { switch (buf[0]) { case 'l': { + if (srclen == 0) + return; + char replybuf[4096]; char *replyend = replybuf + sizeof replybuf; char *reply = replybuf; @@ -802,6 +805,9 @@ handle_control_sock() { } case '?': { + if (srclen == 0) + return; + int i = find_service(buf + 1); if (i < 0) goto fail; |