Skip to content

Commit 76e83f7

Browse files
committed
fix allocation and copy issue
1 parent 1751d5f commit 76e83f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ext/standard/password.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ PHP_FUNCTION(password_needs_rehash)
247247
if (Z_TYPE_PP(option_buffer) != IS_LONG) {
248248
zval *cast_option_buffer;
249249
ALLOC_ZVAL(cast_option_buffer);
250-
INIT_PZVAL_COPY(cast_option_buffer, *option_buffer);
250+
MAKE_COPY_ZVAL(option_buffer, cast_option_buffer);
251251
convert_to_long(cast_option_buffer);
252252
new_cost = Z_LVAL_P(cast_option_buffer);
253253
zval_dtor(cast_option_buffer);
@@ -328,7 +328,7 @@ PHP_FUNCTION(password_hash)
328328
if (Z_TYPE_PP(option_buffer) != IS_LONG) {
329329
zval *cast_option_buffer;
330330
ALLOC_ZVAL(cast_option_buffer);
331-
INIT_PZVAL_COPY(cast_option_buffer, *option_buffer);
331+
MAKE_COPY_ZVAL(option_buffer, cast_option_buffer);
332332
convert_to_long(cast_option_buffer);
333333
cost = Z_LVAL_P(cast_option_buffer);
334334
zval_dtor(cast_option_buffer);
@@ -368,7 +368,7 @@ PHP_FUNCTION(password_hash)
368368
case IS_OBJECT: {
369369
zval *cast_option_buffer;
370370
ALLOC_ZVAL(cast_option_buffer);
371-
INIT_PZVAL_COPY(cast_option_buffer, *option_buffer);
371+
MAKE_COPY_ZVAL(option_buffer, cast_option_buffer);
372372
convert_to_string(cast_option_buffer);
373373
if (Z_TYPE_P(cast_option_buffer) == IS_STRING) {
374374
buffer = estrndup(Z_STRVAL_P(cast_option_buffer), Z_STRLEN_P(cast_option_buffer));

0 commit comments

Comments
 (0)