changeset 1027:2803b7076c83

Checked the length arg when appending data.
author bertrand
date Tue, 05 Jun 2001 08:46:31 +0000
parents 435feedf9f89
children a710b2a06564
files http.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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");