[MPlayer-cvslog] r30951 - trunk/stream/network.c

reimar subversion at mplayerhq.hu
Tue Mar 23 20:45:34 CET 2010


Author: reimar
Date: Tue Mar 23 20:45:33 2010
New Revision: 30951

Log:
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.

Modified:
   trunk/stream/network.c

Modified: trunk/stream/network.c
==============================================================================
--- trunk/stream/network.c	Tue Mar 23 20:40:37 2010	(r30950)
+++ trunk/stream/network.c	Tue Mar 23 20:45:33 2010	(r30951)
@@ -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;
 }
 


More information about the MPlayer-cvslog mailing list