]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix infinite loop when reading multiple lines of input on a broken
authorGeorge Thessalonikefs <yorgos@nlnetlabs.nl>
Tue, 10 Oct 2023 13:17:48 +0000 (15:17 +0200)
committerGeorge Thessalonikefs <yorgos@nlnetlabs.nl>
Tue, 10 Oct 2023 13:17:48 +0000 (15:17 +0200)
  remote control socket. Addesses #947 and #948.

daemon/remote.c
doc/Changelog

index 4990fc8e91950ebabf9be1ac116806298f45c5ed..0460d53086354efa14c51c045bc72bdc83ccfc33 100644 (file)
@@ -590,7 +590,7 @@ ssl_read_line(RES* res, char* buf, size_t max)
                        while(1) {
                                ssize_t rr = recv(res->fd, buf+len, 1, 0);
                                if(rr <= 0) {
-                                       if(rr == 0) {
+                                       if(rr == 0 && len != 0) {
                                                buf[len] = 0;
                                                return 1;
                                        }
index 62b101dd2d3a1489d2f6509f394c1f446dedc597..a943cce5758a8ac4c21ae0389eca126eec24ef92 100644 (file)
@@ -1,3 +1,7 @@
+10 October 2023: George
+       - Fix infinite loop when reading multiple lines of input on a broken
+         remote control socket. Addesses #947 and #948.
+
 9 October 2023: Wouter
        - Fix edns subnet so that queries with a source prefix of zero cause
          the recursor send no edns subnet option to the upstream.