]> granicus.if.org Git - php/commitdiff
Use explicit unaligned type in md5 implementation
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 29 Aug 2019 10:58:22 +0000 (12:58 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 29 Aug 2019 12:47:03 +0000 (14:47 +0200)
ext/standard/md5.c

index 5bf29be2862cd6ddbfd62aac98e315136c966826..463279a497dcce144a9346e25633081aaa967fd1 100644 (file)
@@ -167,8 +167,9 @@ PHP_NAMED_FUNCTION(php_if_md5_file)
  * doesn't work.
  */
 #if defined(__i386__) || defined(__x86_64__) || defined(__vax__)
+typedef ZEND_SET_ALIGNED(1, uint32_t unaligned_uint32_t);
 # define SET(n) \
-       (*(uint32_t *)&ptr[(n) * 4])
+       (*(unaligned_uint32_t *)&ptr[(n) * 4])
 # define GET(n) \
        SET(n)
 #else