Skip to content

Commit

Permalink
Revert "Merge branch 'PHP-8.1'"
Browse files Browse the repository at this point in the history
This reverts commit 6876c20, reversing
changes made to a193427.
  • Loading branch information
devnexen committed Jul 1, 2022
1 parent 6876c20 commit 1a5414c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
3 changes: 0 additions & 3 deletions NEWS
Expand Up @@ -10,9 +10,6 @@ PHP NEWS
- Sockets:
. Added TCP_CONGESTION socket option. (David Carlier)

- Standard:
. Fixed the crypt_sha256/512 api build with clang > 12. (David Carier)

- Zip:

. Implement fseek for zip stream when possible with libzip 1.9.1. (Remi)
Expand Down
12 changes: 6 additions & 6 deletions ext/standard/crypt_sha256.c
Expand Up @@ -377,15 +377,15 @@ char * php_sha256_crypt_r(const char *key, const char *salt, char *buffer, int b
SET_ALLOCA_FLAG(use_heap_key);
SET_ALLOCA_FLAG(use_heap_salt);

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

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

Expand Down
12 changes: 6 additions & 6 deletions ext/standard/crypt_sha512.c
Expand Up @@ -411,15 +411,15 @@ php_sha512_crypt_r(const char *key, const char *salt, char *buffer, int buflen)
SET_ALLOCA_FLAG(use_heap_key);
SET_ALLOCA_FLAG(use_heap_salt);

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

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

Expand Down

0 comments on commit 1a5414c

Please sign in to comment.