Browse code

minor code update

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

Trog authored on 2004/04/05 18:03:53
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Mon Apr  5 10:16:29 BST 2004 (trog)
2
+-----------------------------------
3
+  * libclamav/vba_extract.c: minor code update
4
+
1 5
 Sun Apr  4 02:57:10 CEST 2004 (tk)
2 6
 ----------------------------------
3 7
   * freshclam: do not terminate on SIGALRM (bug introduced on Sat Mar 27),
... ...
@@ -143,16 +143,24 @@ static char *get_unicode_name(char *name, int size, int is_mac)
143 143
 static void vba56_test_middle(int fd)
144 144
 {
145 145
 	char test_middle[20];
146
-	static const uint8_t middle_str[20] = {
146
+
147
+	/* MacOffice middle */
148
+	static const uint8_t middle1_str[20] = {
147 149
 		0x00, 0x01, 0x0d, 0x45, 0x2e, 0xe1, 0xe0, 0x8f, 0x10, 0x1a,
148 150
 		0x85, 0x2e, 0x02, 0x60, 0x8c, 0x4d, 0x0b, 0xb4, 0x00, 0x00
149 151
 	};
152
+	/* MS Office middle */
153
+	static const uint8_t middle2_str[20] = {
154
+		0x00, 0x00, 0xe1, 0x2e, 0x45, 0x0d, 0x8f, 0xe0, 0x1a, 0x10, 
155
+		0x85, 0x2e, 0x02, 0x60, 0x8c, 0x4d, 0x0b, 0xb4, 0x00, 0x00
156
+	};
150 157
 
151 158
         if (cli_readn(fd, &test_middle, 20) != 20) {
152 159
                 return;
153 160
         }
154 161
 
155
-	if (memcmp(test_middle, middle_str, 20) != 0) {
162
+	if ((memcmp(test_middle, middle1_str, 20) != 0) &&
163
+		(memcmp(test_middle, middle2_str, 20) != 0)) {
156 164
 		cli_dbgmsg("middle not found\n");
157 165
 	        lseek(fd, -20, SEEK_CUR);
158 166
 	} else {
... ...
@@ -203,7 +211,7 @@ static int vba_read_project_strings(int fd, int is_mac)
203 203
 				return FALSE;
204 204
 			}
205 205
 			length = vba_endian_convert_16(length, is_mac);
206
-			if (length != 0) {
206
+			if ((length != 0) && (length != 65535)) {
207 207
 				lseek(fd, -2, SEEK_CUR);
208 208
 				free(name);
209 209
 				continue;