git-svn: trunk@3770
Tomasz Kojm authored on 2008/04/08 06:19:05... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Mon Apr 7 22:38:27 CEST 2008 (tk) |
|
2 |
+---------------------------------- |
|
3 |
+ * libclamav/msexpand.c: fix big-endian support |
|
4 |
+ |
|
1 | 5 |
Mon Apr 7 16:04:47 EEST 2008 (edwin) |
2 | 6 |
------------------------------------- |
3 | 7 |
* libclamav, unit-tests: use packed attribute for unaligned access, bb #890. |
... | ... |
@@ -84,7 +84,7 @@ struct msexp_hdr { |
84 | 84 |
if(ret == -1 || (unsigned int) ret != w) \ |
85 | 85 |
return CL_EIO; \ |
86 | 86 |
wbytes += w; \ |
87 |
- if(wbytes >= hdr.fsize) \ |
|
87 |
+ if(wbytes >= EC32(hdr.fsize)) \ |
|
88 | 88 |
return CL_SUCCESS; \ |
89 | 89 |
w = 0; |
90 | 90 |
|
... | ... |
@@ -106,9 +106,9 @@ int cli_msexpand(int fd, int ofd, cli_ctx *ctx) |
106 | 106 |
return CL_EFORMAT; |
107 | 107 |
} |
108 | 108 |
|
109 |
- cli_dbgmsg("MSEXPAND: File size from header: %u\n", hdr.fsize); |
|
109 |
+ cli_dbgmsg("MSEXPAND: File size from header: %u\n", EC32(hdr.fsize)); |
|
110 | 110 |
|
111 |
- if(cli_checklimits("MSEXPAND", ctx, hdr.fsize, 0, 0)!=CL_CLEAN) |
|
111 |
+ if(cli_checklimits("MSEXPAND", ctx, EC32(hdr.fsize), 0, 0)!=CL_CLEAN) |
|
112 | 112 |
return CL_SUCCESS; |
113 | 113 |
|
114 | 114 |
while(1) { |