Skip to content

Commit 51a6bbc

Browse files
committed
Mark parameter in ext/odbc as sensitive
1 parent c6d2648 commit 51a6bbc

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

ext/odbc/odbc.stub.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ function odbc_result_all($statement, string $format = ""): int|false {}
6969
/** @param resource $statement */
7070
function odbc_free_result($statement): bool {}
7171

72-
/** @return resource|false */
72+
/**
73+
* @sensitive-param $password
74+
* @return resource|false
75+
*/
7376
function odbc_connect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER) {}
7477

75-
/** @return resource|false */
78+
/**
79+
* @sensitive-param $password
80+
* @return resource|false
81+
*/
7682
function odbc_pconnect(string $dsn, string $user, string $password, int $cursor_option = SQL_CUR_USE_DRIVER) {}
7783

7884
/** @param resource $odbc */

ext/odbc/odbc_arginfo.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 298e48377c2d18c532d91a9ed97886b49a64c096 */
2+
* Stub hash: 66b702c6f84c0ae63c8aa53c8a667324a71651a0 */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0)
55
ZEND_END_ARG_INFO()
@@ -391,3 +391,9 @@ static const zend_function_entry ext_functions[] = {
391391
ZEND_FE(odbc_connection_string_quote, arginfo_odbc_connection_string_quote)
392392
ZEND_FE_END
393393
};
394+
395+
static void register_odbc_symbols(int module_number)
396+
{
397+
zend_mark_function_parameter_as_sensitive(CG(function_table), "odbc_connect", 2);
398+
zend_mark_function_parameter_as_sensitive(CG(function_table), "odbc_pconnect", 2);
399+
}

ext/odbc/php_odbc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
#include "php.h"
2626
#include "php_globals.h"
27+
#include "zend_attributes.h"
2728

2829
#include "ext/standard/info.h"
2930
#include "ext/standard/php_string.h"
@@ -483,6 +484,8 @@ PHP_MINIT_FUNCTION(odbc)
483484
putenv("DB2NOEXITLIST=TRUE");
484485
#endif
485486

487+
register_odbc_symbols(module_number);
488+
486489
return SUCCESS;
487490
}
488491
/* }}} */

0 commit comments

Comments
 (0)