From 45d513d2068952a1ac24684108501ffc97498e83 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Tue, 10 Jan 2017 21:09:08 +0100 Subject: [PATCH] [rtsp] Do not fail if ContentLength has chars after num value (e.g. whitespace) --- src/evrtsp/rtsp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/evrtsp/rtsp.c b/src/evrtsp/rtsp.c index 04c04c96..f4f74ab4 100644 --- a/src/evrtsp/rtsp.c +++ b/src/evrtsp/rtsp.c @@ -1108,9 +1108,8 @@ evrtsp_get_body_length(struct evrtsp_request *req) /* If there is no Content-Length: header, a value of 0 is assumed, per spec. */ req->ntoread = 0; } else { - char *endp; - ev_int64_t ntoread = evutil_strtoll(content_length, &endp, 10); - if (*content_length == '\0' || *endp != '\0' || ntoread < 0) { + ev_int64_t ntoread = evutil_strtoll(content_length, NULL, 10); + if (*content_length == '\0' || ntoread < 0) { event_warnx("%s: illegal content length: %s", __func__, content_length); return (-1);