Browse code

fix breakage from yesterdays change

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@888 77e5149b-7576-45b1-b177-96237e5ba77b

Trog authored on 2004/09/17 19:09:23
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Fri Sep 17 11:06:42 BST 2004 (trog)
2
+-----------------------------------
3
+  * libclamav/htmlnorm.c: fix breakage resulting from yesterdays change
4
+
1 5
 Fri Sep 17 10:49:30 BST 2004 (njh)
2 6
 ----------------------------------
3 7
   * libclamav:	Handle attempts to falsify the mime type
... ...
@@ -252,7 +252,13 @@ static void html_output_str(file_buff_t *fbuff, unsigned char *str, int len)
252 252
 		if ((fbuff->length + len) >= HTML_FILE_BUFF_LEN) {
253 253
 			html_output_flush(fbuff);
254 254
 		}
255
-		memcpy(fbuff->buffer + fbuff->length, str, len);
255
+		if (len >= HTML_FILE_BUFF_LEN) {
256
+			html_output_flush(fbuff);
257
+			cli_writen(fbuff->fd, str, len);
258
+		} else {
259
+			memcpy(fbuff->buffer + fbuff->length, str, len);
260
+			fbuff->length += len;
261
+		}
256 262
 	}
257 263
 }
258 264
 
... ...
@@ -769,11 +775,11 @@ static int cli_html_normalise(int fd, m_area_t *m_area, const char *dirname, tag
769 769
 					}
770 770
 				} else if (strcmp(tag, "script") == 0) {
771 771
 					arg_value = html_tag_arg_value(&tag_args, "language");
772
-					if (arg_value && (strcmp(arg_value, "jscript.encode") == 0)) {
772
+					if (arg_value && (strcasecmp(arg_value, "jscript.encode") == 0)) {
773 773
 						html_tag_arg_set(&tag_args, "language", "javascript");
774 774
 						state = HTML_SKIP_WS;
775 775
 						next_state = HTML_JSDECODE;
776
-					} else if (arg_value && (strcmp(arg_value, "vbscript.encode") == 0)) {
776
+					} else if (arg_value && (strcasecmp(arg_value, "vbscript.encode") == 0)) {
777 777
 						html_tag_arg_set(&tag_args, "language", "vbscript");
778 778
 						state = HTML_SKIP_WS;
779 779
 						next_state = HTML_JSDECODE;