@@ -1452,7 +1452,7 @@ static void php_oci_pconnection_list_np_dtor(zend_resource *entry)
1452
1452
/* Remove the hash entry if present */
1453
1453
if (connection -> hash_key ) {
1454
1454
zvp = zend_hash_find (& EG (persistent_list ), connection -> hash_key );
1455
- le = zvp ? Z_RES_P (zvp ) : NULL ; /* PHPNG TODO check for null zvp */
1455
+ le = zvp ? Z_RES_P (zvp ) : NULL ;
1456
1456
if (le != NULL && le -> type == le_pconnection && le -> ptr == connection ) {
1457
1457
zend_hash_del (& EG (persistent_list ), connection -> hash_key );
1458
1458
}
@@ -1927,13 +1927,11 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
1927
1927
}
1928
1928
1929
1929
/* make it lowercase */
1930
- /* PHPNG TODO is this safe to do? What about interned strings? */
1931
- php_strtolower (hashed_details .s -> val , hashed_details .s -> len );
1930
+ php_strtolower (ZSTR_VAL (hashed_details .s ), ZSTR_LEN (hashed_details .s ));
1932
1931
1933
1932
if (!exclusive && !new_password ) {
1934
1933
zend_bool found = 0 ;
1935
1934
1936
- /* PHPNG TODO Check hashed_details is used correctly */
1937
1935
if (persistent && ((zvp = zend_hash_find (& EG (persistent_list ), hashed_details .s ))) != NULL ) {
1938
1936
zend_resource * le = Z_RES_P (zvp );
1939
1937
@@ -1948,7 +1946,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
1948
1946
if (le -> type == le_index_ptr ) {
1949
1947
zend_resource * ptr ;
1950
1948
1951
- ptr = (zend_resource * ) le -> ptr ; /* PHPNG TODO */
1949
+ ptr = (zend_resource * ) le -> ptr ;
1952
1950
if (ptr && (ptr -> type == le_connection )) {
1953
1951
connection = (php_oci_connection * )ptr -> ptr ;
1954
1952
}
@@ -2011,8 +2009,8 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
2011
2009
}
2012
2010
2013
2011
if ((tmp_val != NULL ) && (tmp != NULL ) &&
2014
- (tmp -> hash_key -> len == hashed_details .s -> len ) &&
2015
- (memcmp (tmp -> hash_key -> val , hashed_details .s -> val , tmp -> hash_key -> len ) == 0 )) {
2012
+ (ZSTR_LEN ( tmp -> hash_key ) == ZSTR_LEN ( hashed_details .s ) ) &&
2013
+ (memcmp (ZSTR_VAL ( tmp -> hash_key ), ZSTR_VAL ( hashed_details .s ), ZSTR_LEN ( tmp -> hash_key ) ) == 0 )) {
2016
2014
connection = tmp ;
2017
2015
++ GC_REFCOUNT (connection -> id );
2018
2016
/* do nothing */
@@ -2866,7 +2864,7 @@ static php_oci_spool *php_oci_create_spool(char *username, int username_len, cha
2866
2864
}
2867
2865
2868
2866
/* Populate key if passed */
2869
- if (hash_key && hash_key -> val ) {
2867
+ if (hash_key && ( ZSTR_LEN ( hash_key ) > 0 ) ) {
2870
2868
session_pool -> spool_hash_key = zend_string_dup (hash_key , 1 );
2871
2869
if (session_pool -> spool_hash_key == NULL ) {
2872
2870
iserror = 1 ;
@@ -3022,8 +3020,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
3022
3020
/* Session Pool Hash Key : oci8spool***username**edition**hashedpassword**dbname**charset */
3023
3021
3024
3022
smart_str_0 (& spool_hashed_details );
3025
- /* PHPNG TODO is this safe to do? */
3026
- php_strtolower (spool_hashed_details .s -> val , spool_hashed_details .s -> len );
3023
+ php_strtolower (ZSTR_VAL (spool_hashed_details .s ), ZSTR_LEN (spool_hashed_details .s ));
3027
3024
/* }}} */
3028
3025
3029
3026
spool_out_zv = zend_hash_find (& EG (persistent_list ), spool_hashed_details .s );
@@ -3044,8 +3041,8 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
3044
3041
PHP_OCI_REGISTER_RESOURCE (session_pool , le_psessionpool );
3045
3042
zend_hash_update_mem (& EG (persistent_list ), session_pool -> spool_hash_key , (void * )& spool_le , sizeof (zend_resource ));
3046
3043
} else if (spool_out_le -> type == le_psessionpool &&
3047
- (( php_oci_spool * )(spool_out_le -> ptr ))-> spool_hash_key -> len == spool_hashed_details .s -> len &&
3048
- memcmp ((( php_oci_spool * )(spool_out_le -> ptr ))-> spool_hash_key -> val , spool_hashed_details .s -> val , spool_hashed_details .s -> len ) == 0 ) {
3044
+ ZSTR_LEN ((( php_oci_spool * )(spool_out_le -> ptr ))-> spool_hash_key ) == ZSTR_LEN ( spool_hashed_details .s ) &&
3045
+ memcmp (ZSTR_VAL ((( php_oci_spool * )(spool_out_le -> ptr ))-> spool_hash_key ), ZSTR_VAL ( spool_hashed_details .s ), ZSTR_LEN ( spool_hashed_details .s ) ) == 0 ) {
3049
3046
/* retrieve the cached session pool */
3050
3047
session_pool = (php_oci_spool * )(spool_out_le -> ptr );
3051
3048
}
0 commit comments