Merged 0410dc655d45 from the 2.0-stable branch: strict-aliasing fix.
--- a/.hgtags Sat May 02 23:25:41 2009 -0700
+++ b/.hgtags Sun May 03 01:36:18 2009 -0700
@@ -11,3 +11,4 @@
d94f1ccac8095509c57ad640d54796aea0d260f0 release-0.1.5
fe0c1d6f40afa6fca09a277a1ade59231f16c66f release-1.1.1
5d70fca3be361258edfb59c3edaba5abe75a1e88 release-2.0.0
+df04959950eb3830c39adfa983789f70f86062d7 release-1.1.0
--- a/src/archiver_zip.c Sat May 02 23:25:41 2009 -0700
+++ b/src/archiver_zip.c Sun May 03 01:36:18 2009 -0700
@@ -373,13 +373,13 @@
static PHYSFS_sint64 zip_find_end_of_central_dir(void *in, PHYSFS_sint64 *len)
{
PHYSFS_uint8 buf[256];
+ PHYSFS_uint8 extra[4];
PHYSFS_sint32 i = 0;
PHYSFS_sint64 filelen;
PHYSFS_sint64 filepos;
PHYSFS_sint32 maxread;
PHYSFS_sint32 totalread = 0;
int found = 0;
- PHYSFS_uint32 extra = 0;
filelen = __PHYSFS_platformFileLength(in);
BAIL_IF_MACRO(filelen == -1, NULL, 0); /* !!! FIXME: unlocalized string */
@@ -417,7 +417,7 @@
{
if (__PHYSFS_platformRead(in, buf, maxread - 4, 1) != 1)
return(-1);
- *((PHYSFS_uint32 *) (&buf[maxread - 4])) = extra;
+ memcpy(&buf[maxread - 4], &extra, sizeof (extra));
totalread += maxread - 4;
} /* if */
else
@@ -427,7 +427,7 @@
totalread += maxread;
} /* else */
- extra = *((PHYSFS_uint32 *) (&buf[0]));
+ memcpy(&extra, buf, sizeof (extra));
for (i = maxread - 4; i > 0; i--)
{