Browse code

Short binhex data could confuse things

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

Nigel Horne authored on 2004/05/28 01:52:47
Showing 1 changed files
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: message.c,v $
20
+ * Revision 1.57  2004/05/27 16:52:47  nigelhorne
21
+ * Short binhex data could confuse things
22
+ *
20 23
  * Revision 1.56  2004/05/19 10:02:25  nigelhorne
21 24
  * Default encoding for attachments set to base64
22 25
  *
... ...
@@ -165,7 +168,7 @@
165 165
  * uuencodebegin() no longer static
166 166
  *
167 167
  */
168
-static	char	const	rcsid[] = "$Id: message.c,v 1.56 2004/05/19 10:02:25 nigelhorne Exp $";
168
+static	char	const	rcsid[] = "$Id: message.c,v 1.57 2004/05/27 16:52:47 nigelhorne Exp $";
169 169
 
170 170
 #if HAVE_CONFIG_H
171 171
 #include "clamav-config.h"
... ...
@@ -1118,6 +1121,13 @@ messageToBlob(message *m)
1118 1118
 		 */
1119 1119
 		byte += 10;
1120 1120
 
1121
+		l = blobGetDataSize(tmp);
1122
+
1123
+		if(l < len) {
1124
+			cli_warnmsg("Corrupt BinHex file, claims it is %lu bytes long in a message of %lu bytes\n",
1125
+				len, l);
1126
+			len = l;
1127
+		}
1121 1128
 		blobAddData(b, &data[byte], len);
1122 1129
 
1123 1130
 		blobDestroy(tmp);