git-svn: trunk@2002
Tomasz Kojm authored on 2006/05/31 00:19:48... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Tue May 30 17:18:15 CEST 2006 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/unzip.c: fix alignment problem on SPARC reported by Andy Fiddaman |
|
4 |
+ |
|
1 | 5 |
Tue May 30 15:45:24 CEST 2006 (tk) |
2 | 6 |
---------------------------------- |
3 | 7 |
* libclamav/others.h: add missing brackets to some endian macros, spotted |
... | ... |
@@ -175,6 +175,7 @@ int __zip_parse_root_directory(int fd, struct zip_disk_trailer *trailer, zip_dir |
175 | 175 |
uint32_t u_rootsize = EC32(trailer->z_rootsize); |
176 | 176 |
uint32_t u_rootseek = EC32(trailer->z_rootseek) + start; |
177 | 177 |
uint16_t u_extras, u_comment, u_namlen, u_flags; |
178 |
+ char *pt; |
|
178 | 179 |
|
179 | 180 |
|
180 | 181 |
if(fstat(fd, &sb) == -1) { |
... | ... |
@@ -256,8 +257,12 @@ int __zip_parse_root_directory(int fd, struct zip_disk_trailer *trailer, zip_dir |
256 | 256 |
break; |
257 | 257 |
} |
258 | 258 |
|
259 |
- hdr->d_reclen = (uint16_t) (sizeof(zip_dir_hdr) + u_namlen + 1); |
|
259 |
+ pt = (char *) hdr + sizeof(zip_dir_hdr) + u_namlen + 1; |
|
260 |
+ pt += ((long) pt) & 1; |
|
261 |
+ pt += ((long) pt) & 2; |
|
262 |
+ hdr->d_reclen = (uint16_t) (pt - (char *) hdr); |
|
260 | 263 |
p_reclen = &hdr->d_reclen; |
264 |
+ |
|
261 | 265 |
hdr = (zip_dir_hdr *) ((char *) hdr + hdr->d_reclen); |
262 | 266 |
} |
263 | 267 |
|