Skip to content

Commit 1a5414c

Browse files
committed
Revert "Merge branch 'PHP-8.1'"
This reverts commit 6876c20, reversing changes made to a193427.
1 parent 6876c20 commit 1a5414c

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

NEWS

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ PHP NEWS
1010
- Sockets:
1111
. Added TCP_CONGESTION socket option. (David Carlier)
1212

13-
- Standard:
14-
. Fixed the crypt_sha256/512 api build with clang > 12. (David Carier)
15-
1613
- Zip:
1714

1815
. Implement fseek for zip stream when possible with libzip 1.9.1. (Remi)

ext/standard/crypt_sha256.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,15 +377,15 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b
377377
SET_ALLOCA_FLAG(use_heap_key);
378378
SET_ALLOCA_FLAG(use_heap_salt);
379379

380-
if ((uintptr_t)key % __alignof__ (uint32_t) != 0) {
381-
char *tmp = (char *) do_alloca(key_len + __alignof__(uint32_t), use_heap_key);
382-
key = copied_key = memcpy(tmp + __alignof__(uint32_t) - (uintptr_t)tmp % __alignof__(uint32_t), key, key_len);
380+
if ((key - (char *) 0) % __alignof__ (uint32_t) != 0) {
381+
tmp_key = (char *) do_alloca(key_len + __alignof__(uint32_t), use_heap_key);
382+
key = copied_key = memcpy(tmp_key + __alignof__(uint32_t) - (tmp_key - (char *) 0) % __alignof__(uint32_t), key, key_len);
383383
}
384384

385-
if ((uintptr_t)salt % __alignof__(uint32_t) != 0) {
386-
char *tmp = (char *) do_alloca(salt_len + 1 + __alignof__(uint32_t), use_heap_salt);
385+
if ((salt - (char *) 0) % __alignof__(uint32_t) != 0) {
386+
tmp_salt = (char *) do_alloca(salt_len + 1 + __alignof__(uint32_t), use_heap_salt);
387387
salt = copied_salt =
388-
memcpy(tmp + __alignof__(uint32_t) - (uintptr_t)tmp % __alignof__ (uint32_t), salt, salt_len);
388+
memcpy(tmp_salt + __alignof__(uint32_t) - (tmp_salt - (char *) 0) % __alignof__ (uint32_t), salt, salt_len);
389389
copied_salt[salt_len] = 0;
390390
}
391391

ext/standard/crypt_sha512.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,15 +411,15 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
411411
SET_ALLOCA_FLAG(use_heap_key);
412412
SET_ALLOCA_FLAG(use_heap_salt);
413413

414-
if ((uintptr_t)key % __alignof__ (uint64_t) != 0) {
415-
char *tmp = (char *) do_alloca (key_len + __alignof__ (uint64_t), use_heap_key);
414+
if ((key - (char *) 0) % __alignof__ (uint64_t) != 0) {
415+
tmp_key = (char *) do_alloca(key_len + __alignof__ (uint64_t), use_heap_key);
416416
key = copied_key =
417-
memcpy(tmp + __alignof__(uint64_t) - (uintptr_t)tmp % __alignof__(uint64_t), key, key_len);
417+
memcpy(tmp_key + __alignof__(uint64_t) - (tmp_key - (char *) 0) % __alignof__(uint64_t), key, key_len);
418418
}
419419

420-
if ((uintptr_t)salt % __alignof__ (uint64_t) != 0) {
421-
char *tmp = (char *) do_alloca(salt_len + 1 + __alignof__(uint64_t), use_heap_salt);
422-
salt = copied_salt = memcpy(tmp + __alignof__(uint64_t) - (uintptr_t)tmp % __alignof__(uint64_t), salt, salt_len);
420+
if ((salt - (char *) 0) % __alignof__ (uint64_t) != 0) {
421+
tmp_salt = (char *) do_alloca(salt_len + 1 + __alignof__(uint64_t), use_heap_salt);
422+
salt = copied_salt = memcpy(tmp_salt + __alignof__(uint64_t) - (tmp_salt - (char *) 0) % __alignof__(uint64_t), salt, salt_len);
423423
copied_salt[salt_len] = 0;
424424
}
425425

0 commit comments

Comments
 (0)