Commit af2281d5 authored by Filip Roséen's avatar Filip Roséen Committed by Jean-Baptiste Kempf

realrtsp: Fixed crash when 'RealChallenge1' is missing from initial server reply

The module would crash if the remote server did not include `RealChallenge1` in
the headers of the initial reply after establishing a connection. The below is a
sample testcase:

% nc -l -p 8080 <<EOF
> RTSP/1.0 200 OK
> Server: Real
>
> EOF
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 68d8ea52
......@@ -622,10 +622,17 @@ rmff_header_t *real_setup_and_get_header(rtsp_client_t *rtsp_session, int bandw
char *mrl=rtsp_get_mrl(rtsp_session);
unsigned int size;
int status;
char *p_data;
/* get challenge */
challenge1=strdup(rtsp_search_answers(rtsp_session,"RealChallenge1"));
msg_Dbg(p_access, "Challenge1: %s", challenge1);
if (NULL == (p_data = rtsp_search_answers(rtsp_session, "RealChallenge1"))) {
msg_Warn(p_access, "server did not reply with RealChallenge1, aborting!");
return NULL;
} else {
challenge1 = strdup(p_data);
msg_Dbg(p_access, "Challenge1: %s", challenge1);
}
sprintf(buf, "Bandwidth: %u", bandwidth);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment