Module: kamailio
Branch: master
Commit: a1bc202d3ba929a28011921a08293a8ca15e95b6
URL: 
https://github.com/kamailio/kamailio/commit/a1bc202d3ba929a28011921a08293a8ca15e95b6

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2026-06-14T21:42:22+02:00

ctl: fifo - catch \r for eol

---

Modified: src/modules/ctl/fifo_server.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/a1bc202d3ba929a28011921a08293a8ca15e95b6.diff
Patch: 
https://github.com/kamailio/kamailio/commit/a1bc202d3ba929a28011921a08293a8ca15e95b6.patch

---

diff --git a/src/modules/ctl/fifo_server.c b/src/modules/ctl/fifo_server.c
index 2d671798cce..bbdaed6d120 100644
--- a/src/modules/ctl/fifo_server.c
+++ b/src/modules/ctl/fifo_server.c
@@ -553,8 +553,13 @@ static int read_line(char **b, int *read, struct 
readline_handle *rh)
                /* end, nothing more to read */
                return -1;
        }
-       for(eol = rh->crt; (eol < rh->end) && (*eol != '\n'); eol++)
+       for(eol = rh->crt; (eol < rh->end) && (*eol != '\n') && (*eol != '\r');
+                       eol++)
                ;
+       if(eol >= rh->end) {
+               /* request buffer ended without a line delimiter */
+               return -1;
+       }
        *eol = 0;
        trim = eol;
        /* trim spaces at the end */

_______________________________________________
Kamailio - Development Mailing List -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!

Reply via email to