Browse code

libclamav/filetypes.c: fix off-by-one error (bb#1639)

Tomasz Kojm authored on 2009/07/15 18:21:36
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Jul 15 11:20:56 CEST 2009 (tk)
2
+----------------------------------
3
+ * libclamav/filetypes.c: fix off-by-one error (bb#1639)
4
+
1 5
 Wed Jul 15 08:46:35 CEST 2009 (tk)
2 6
 ----------------------------------
3 7
  * libclamav/mspack.c: fix valgrind warnings about use of uninitialized
... ...
@@ -216,7 +216,6 @@ cli_file_t cli_filetype2(int desc, const struct cl_engine *engine)
216 216
 			     * However when detecting whether a file is HTML or not, we need exact conversion.
217 217
 			     * (just eliminating zeros and matching would introduce false positives */
218 218
 			    if(encoding_normalize_toascii(&in_area, encoding, &out_area) >= 0 && out_area.length > 0) {
219
-				    out_area.buffer[out_area.length] = '\0';
220 219
 				    if(cli_ac_initdata(&mdata, root->ac_partsigs, root->ac_lsigs, CLI_DEFAULT_AC_TRACKLEN))
221 220
 					    return ret;
222 221