Browse code

a couple of fixes from Edwin

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

Tomasz Kojm authored on 2007/02/13 22:16:56
Showing 1 changed files
... ...
@@ -528,6 +528,7 @@ void process_encoding_set(struct entity_conv* conv,const unsigned char* encoding
528 528
 		return;
529 529
 
530 530
 	tmp_encoding = normalize_encoding(encoding);/* FIXME: better obey priorities*/
531
+	if(prio == META) {
531 532
 	old_size = encoding_bytes(conv->encoding,&tmp);
532 533
 	new_size = encoding_bytes(tmp_encoding,&tmp);
533 534
 	if(old_size != new_size)  {
... ...
@@ -535,6 +536,7 @@ void process_encoding_set(struct entity_conv* conv,const unsigned char* encoding
535 535
 		free(tmp_encoding);
536 536
 		return;
537 537
 	}
538
+	}
538 539
 	free(conv->encoding);
539 540
 	conv->encoding = tmp_encoding;
540 541
 	cli_dbgmsg("New encoding for %x:%s\n",conv,conv->encoding);
... ...
@@ -952,10 +954,11 @@ unsigned char* encoding_norm_readline(struct entity_conv* conv, FILE* stream_in,
952 952
 			}
953 953
 			else {
954 954
 				char buff[10];
955
-				const int len = strlen(buff);
955
+				int len;
956 956
 
957 957
 				snprintf(buff,9,"&#%d;",u16);
958 958
 				buff[9] = '\0';
959
+				len = strlen(buff);
959 960
 				if((norm_end - norm) <= len)
960 961
 					/* prevent buffer overflow */
961 962
 					break;