Browse code

fix memory corruption in experimental code (bb#227)

git-svn: trunk@2631

Tomasz Kojm authored on 2007/01/16 09:24:35
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Jan 16 01:22:42 CET 2007 (tk)
2
+---------------------------------
3
+  * libclamav/entconv.c: fix memory corruption in experimental code (bb#227)
4
+
1 5
 Mon Jan 15 20:58:54 CET 2007 (tk)
2 6
 ---------------------------------
3 7
   * libclamav: make cli_lockdb() errors non critical (bb#232)
... ...
@@ -735,6 +735,8 @@ unsigned char* encoding_norm_readline(struct entity_conv* conv, FILE* stream_in,
735 735
 				*norm++ = (unsigned char)u16;
736 736
 			}
737 737
 			else if (u16 == 160)  {/*nbsp*/
738
+				if(norm >= norm_end)
739
+					break;
738 740
 				*norm++ = 0x20;
739 741
 			}
740 742
 			else {