Skip to content

Commit c61396c

Browse files
committed
Fixed#1895
1 parent e9ba9ff commit c61396c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

library.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,11 @@ static zend_string *redis_hash_auth(zend_string *user, zend_string *pass) {
721721
smart_str_appendl_ex(&salted, REDIS_G(salt), sizeof(REDIS_G(salt)), 0);
722722

723723
ctx = emalloc(ops->context_size);
724+
#if PHP_VERSION_ID >= 80100
725+
ops->hash_init(ctx,NULL);
726+
#else
724727
ops->hash_init(ctx);
728+
#endif
725729
ops->hash_update(ctx, (const unsigned char *)ZSTR_VAL(salted.s), ZSTR_LEN(salted.s));
726730

727731
digest = emalloc(ops->digest_size);

redis_array_impl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,11 @@ ra_find_node(RedisArray *ra, const char *key, int key_len, int *out_pos)
494494
void *ctx = emalloc(ops->context_size);
495495
unsigned char *digest = emalloc(ops->digest_size);
496496

497+
#if PHP_VERSION_ID >= 80100
498+
ops->hash_init(ctx,NULL);
499+
#else
497500
ops->hash_init(ctx);
501+
#endif
498502
ops->hash_update(ctx, (const unsigned char *)ZSTR_VAL(out), ZSTR_LEN(out));
499503
ops->hash_final(digest, ctx);
500504

0 commit comments

Comments
 (0)