1
mirror of https://github.com/mpv-player/mpv synced 2025-01-24 19:37:30 +01:00

Make http_read_response fail if parsing the response failed.

Avoids possible crashes since other code assumes http_hdr->protocol
is a valid string if it succeeds.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30951 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2010-03-23 19:45:33 +00:00
parent db734715dc
commit f76e141402

View File

@ -299,7 +299,10 @@ http_read_response( int fd ) {
}
http_response_append( http_hdr, response, i );
} while( !http_is_header_entire( http_hdr ) );
http_response_parse( http_hdr );
if (http_response_parse( http_hdr ) < 0) {
http_free( http_hdr );
return NULL;
}
return http_hdr;
}