Skip to content

Commit ac3984d

Browse files
committed
PHPC-123: Wrong sizeof argument
I've stared at this for a while and have come to the conclusion that the ZEND_STRS macro is confusing coverity.
1 parent c73c3fd commit ac3984d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/MongoDB/Manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ PHP_METHOD(Manager, __construct)
105105
if (zend_hash_find(Z_ARRVAL_P(driverOptions), "debug", strlen("debug") + 1, (void**)&tmp) == SUCCESS) {
106106
convert_to_string(*tmp);
107107

108-
zend_alter_ini_entry_ex(ZEND_STRS((char *)"phongo.debug_log"), Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
108+
zend_alter_ini_entry_ex((char *)"phongo.debug_log", sizeof("phongo.debug_log") , Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
109109
}
110110
}
111111

src/MongoDB/Server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ PHP_METHOD(Server, __construct)
9191
if (zend_hash_find(Z_ARRVAL_P(driverOptions), "debug", strlen("debug") + 1, (void**)&tmp) == SUCCESS) {
9292
convert_to_string(*tmp);
9393

94-
zend_alter_ini_entry_ex(ZEND_STRS((char *)"phongo.debug_log"), Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
94+
zend_alter_ini_entry_ex((char *)"phongo.debug_log", sizeof("phongo.debug_log") , Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp), PHP_INI_USER, PHP_INI_STAGE_RUNTIME, 0 TSRMLS_CC);
9595
}
9696
}
9797

0 commit comments

Comments
 (0)