mirror of
https://github.com/curl/curl.git
synced 2026-07-24 03:07:17 +03:00
RTSP: avoid integer overflow on funny RTSP response
... like a very large non-existing RTSP version number. Added test 577 to verify. Detected by OSS-fuzz. Closes #1969
This commit is contained in:
parent
eb04636d68
commit
232dffcf24
3 changed files with 60 additions and 3 deletions
|
|
@ -3387,12 +3387,14 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
|
|||
}
|
||||
}
|
||||
else if(conn->handler->protocol & CURLPROTO_RTSP) {
|
||||
char separator;
|
||||
nc = sscanf(HEADER1,
|
||||
" RTSP/%d.%d %3d",
|
||||
" RTSP/%1d.%1d%c%3d",
|
||||
&rtspversion_major,
|
||||
&conn->rtspversion,
|
||||
&separator,
|
||||
&k->httpcode);
|
||||
if(nc == 3) {
|
||||
if((nc == 4) && (' ' == separator)) {
|
||||
conn->rtspversion += 10 * rtspversion_major;
|
||||
conn->httpversion = 11; /* For us, RTSP acts like HTTP 1.1 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue