summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-23 19:45:33 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-03-23 19:45:33 +0000
commitf76e1414025bacbd038ad68901e86df0f31d1767 (patch)
tree9d52d10c2d72ae83f4e794e36043943afec7adf0 /stream
parentdb734715dc7a5913713670293cfbf7fa597f3136 (diff)
downloadmpv-f76e1414025bacbd038ad68901e86df0f31d1767.tar.bz2
mpv-f76e1414025bacbd038ad68901e86df0f31d1767.tar.xz
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
Diffstat (limited to 'stream')
-rw-r--r--stream/network.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/network.c b/stream/network.c
index 9750d28478..bb866318e0 100644
--- a/stream/network.c
+++ b/stream/network.c
@@ -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;
}