diff http.c @ 1027:2803b7076c83

Checked the length arg when appending data.
author bertrand
date Tue, 05 Jun 2001 08:46:31 +0000
parents ede5785faa53
children
line wrap: on
line diff
--- a/http.c	Tue Jun 05 08:42:16 2001 +0000
+++ b/http.c	Tue Jun 05 08:46:31 2001 +0000
@@ -40,7 +40,7 @@
 int
 http_response_append( HTTP_header_t *http_hdr, char *response, int length ) {
 	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 );
 	if( ptr==NULL ) {
 		printf("Memory allocation failed\n");