]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
if there's leftover bytes, ensure there's always more data to read
authorAlan T. DeKok <aland@freeradius.org>
Fri, 10 Nov 2017 19:46:11 +0000 (14:46 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 10 Nov 2017 19:46:11 +0000 (14:46 -0500)
src/modules/proto_detail/proto_detail_work.c

index 73c67eac1df8ca3ec1ef9f27486d23240326cba5..f1d4019328e3222cd56b9444e693929533968ce1 100644 (file)
@@ -440,6 +440,11 @@ done:
        if (!inst->paused) {
                (void) fr_event_filter_update(inst->el, inst->fd, FR_EVENT_FILTER_IO, pause_read);
                inst->paused = true;
+
+               /*
+                *      Back up so that read() knows there's more data.
+                */
+               if (*leftover) (void) lseek(inst->fd, inst->read_offset - 1, SEEK_SET);
        }
 
        /*