@@ -541,15 +541,14 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT
541
541
rc = -1 ;
542
542
php_error_docref (NULL , E_WARNING , "Failed to allocate control value" );
543
543
} else {
544
- int num_attribs , i ;
545
544
zval * attr ;
546
545
547
- num_attribs = zend_hash_num_elements (Z_ARRVAL_P (tmp ));
546
+ uint32_t num_attribs = zend_hash_num_elements (Z_ARRVAL_P (tmp ));
548
547
ldap_attrs = safe_emalloc ((num_attribs + 1 ), sizeof (char * ), 0 );
549
548
tmpstrings1 = safe_emalloc (num_attribs , sizeof (zend_string * ), 0 );
550
549
num_tmpstrings1 = 0 ;
551
550
552
- for (i = 0 ; i < num_attribs ; i ++ ) {
551
+ for (uint32_t i = 0 ; i < num_attribs ; i ++ ) {
553
552
if ((attr = zend_hash_index_find (Z_ARRVAL_P (tmp ), i )) == NULL ) {
554
553
rc = -1 ;
555
554
php_error_docref (NULL , E_WARNING , "Failed to encode attribute list" );
@@ -582,17 +581,16 @@ static int php_ldap_control_from_array(LDAP *ld, LDAPControl** ctrl, const HashT
582
581
}
583
582
}
584
583
} else if (zend_string_equals_literal (control_oid , LDAP_CONTROL_SORTREQUEST )) {
585
- int num_keys , i ;
586
584
zval * sortkey , * tmp ;
587
585
588
- num_keys = zend_hash_num_elements (Z_ARRVAL_P (val ));
586
+ uint32_t num_keys = zend_hash_num_elements (Z_ARRVAL_P (val ));
589
587
sort_keys = safe_emalloc ((num_keys + 1 ), sizeof (LDAPSortKey * ), 0 );
590
588
tmpstrings1 = safe_emalloc (num_keys , sizeof (zend_string * ), 0 );
591
589
tmpstrings2 = safe_emalloc (num_keys , sizeof (zend_string * ), 0 );
592
590
num_tmpstrings1 = 0 ;
593
591
num_tmpstrings2 = 0 ;
594
592
595
- for (i = 0 ; i < num_keys ; i ++ ) {
593
+ for (uint32_t i = 0 ; i < num_keys ; i ++ ) {
596
594
if ((sortkey = zend_hash_index_find (Z_ARRVAL_P (val ), i )) == NULL ) {
597
595
rc = -1 ;
598
596
php_error_docref (NULL , E_WARNING , "Failed to encode sort keys list" );
0 commit comments