@@ -643,12 +643,6 @@ PHP_FUNCTION(hash_init)
643
643
hash -> context = context ;
644
644
hash -> options = options ;
645
645
hash -> key = NULL ;
646
- if (args && zend_hash_num_elements (args )) {
647
- hash -> args = args ;
648
- GC_TRY_ADDREF (hash -> args );
649
- } else {
650
- hash -> args = NULL ;
651
- }
652
646
653
647
if (options & PHP_HASH_HMAC ) {
654
648
char * K = emalloc (ops -> block_size );
@@ -803,7 +797,7 @@ PHP_FUNCTION(hash_final)
803
797
}
804
798
805
799
/* Feed this result into the outer hash */
806
- hash -> ops -> hash_init (hash -> context , hash -> args );
800
+ hash -> ops -> hash_init (hash -> context , NULL );
807
801
hash -> ops -> hash_update (hash -> context , hash -> key , hash -> ops -> block_size );
808
802
hash -> ops -> hash_update (hash -> context , (unsigned char * ) ZSTR_VAL (digest ), hash -> ops -> digest_size );
809
803
hash -> ops -> hash_final ((unsigned char * ) ZSTR_VAL (digest ), hash -> context );
@@ -1392,11 +1386,6 @@ static void php_hashcontext_dtor(zend_object *obj) {
1392
1386
efree (hash -> key );
1393
1387
hash -> key = NULL ;
1394
1388
}
1395
-
1396
- if (hash -> args ) {
1397
- zend_array_release (hash -> args );
1398
- hash -> args = NULL ;
1399
- }
1400
1389
}
1401
1390
/* }}} */
1402
1391
@@ -1411,7 +1400,7 @@ static zend_object *php_hashcontext_clone(zend_object *zobj) {
1411
1400
newobj -> ops = oldobj -> ops ;
1412
1401
newobj -> options = oldobj -> options ;
1413
1402
newobj -> context = php_hash_alloc_context (newobj -> ops );
1414
- newobj -> ops -> hash_init (newobj -> context , oldobj -> args );
1403
+ newobj -> ops -> hash_init (newobj -> context , NULL );
1415
1404
1416
1405
if (SUCCESS != newobj -> ops -> hash_copy (newobj -> ops , oldobj -> context , newobj -> context )) {
1417
1406
efree (newobj -> context );
@@ -1487,14 +1476,6 @@ PHP_METHOD(HashContext, __serialize)
1487
1476
Z_TRY_ADDREF (tmp );
1488
1477
zend_hash_next_index_insert (Z_ARRVAL_P (return_value ), & tmp );
1489
1478
1490
- if (hash -> args ) {
1491
- ZVAL_ARR (& tmp , hash -> args );
1492
- Z_TRY_ADDREF (tmp );
1493
- } else {
1494
- ZVAL_NULL (& tmp );
1495
- }
1496
- zend_hash_next_index_insert (Z_ARRVAL_P (return_value ), & tmp );
1497
-
1498
1479
return ;
1499
1480
1500
1481
serialize_failure :
@@ -1558,14 +1539,7 @@ PHP_METHOD(HashContext, __unserialize)
1558
1539
hash -> ops = ops ;
1559
1540
hash -> context = php_hash_alloc_context (ops );
1560
1541
hash -> options = options ;
1561
- if (args_zv && IS_ARRAY == Z_TYPE_P (args_zv ) && zend_hash_num_elements (Z_ARRVAL_P (args_zv )) > 0 ) {
1562
- ops -> hash_init (hash -> context , Z_ARRVAL_P (args_zv ));
1563
- hash -> args = Z_ARRVAL_P (args_zv );
1564
- GC_TRY_ADDREF (hash -> args );
1565
- } else {
1566
- ops -> hash_init (hash -> context , NULL );
1567
- hash -> args = NULL ;
1568
- }
1542
+ ops -> hash_init (hash -> context , NULL );
1569
1543
1570
1544
unserialize_result = ops -> hash_unserialize (hash , magic , hash_zv );
1571
1545
if (unserialize_result != SUCCESS ) {
0 commit comments