Checked the length arg when appending data.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1028 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
bertrand 2001-06-05 08:46:31 +00:00
parent a279c993dc
commit 36dc28b88b
1 changed files with 1 additions and 1 deletions

2
http.c
View File

@ -40,7 +40,7 @@ http_free( HTTP_header_t *http_hdr ) {
int int
http_response_append( HTTP_header_t *http_hdr, char *response, int length ) { http_response_append( HTTP_header_t *http_hdr, char *response, int length ) {
char *ptr = NULL; char *ptr = NULL;
if( http_hdr==NULL || response==NULL ) return -1; if( http_hdr==NULL || response==NULL || length<0 ) return -1;
ptr = (char*)malloc( http_hdr->buffer_size+length ); ptr = (char*)malloc( http_hdr->buffer_size+length );
if( ptr==NULL ) { if( ptr==NULL ) {
printf("Memory allocation failed\n"); printf("Memory allocation failed\n");