Skip to content

Commit 4914ead

Browse files
committed
Merge branch 'PHP-8.1'
* PHP-8.1: fix [-Wmaybe-uninitialized] build warnings
2 parents 5355cf3 + 6ee96f0 commit 4914ead

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ext/openssl/openssl.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3969,6 +3969,8 @@ static EVP_PKEY *php_openssl_pkey_init_dsa(zval *data, bool *is_private)
39693969
OPENSSL_PKEY_SET_BN(data, priv_key);
39703970
OPENSSL_PKEY_SET_BN(data, pub_key);
39713971

3972+
*is_private = false;
3973+
39723974
if (!ctx || !bld || !p || !q || !g) {
39733975
goto cleanup;
39743976
}
@@ -4140,6 +4142,8 @@ static EVP_PKEY *php_openssl_pkey_init_dh(zval *data, bool *is_private)
41404142
OPENSSL_PKEY_SET_BN(data, priv_key);
41414143
OPENSSL_PKEY_SET_BN(data, pub_key);
41424144

4145+
*is_private = false;
4146+
41434147
if (!ctx || !bld || !p || !g) {
41444148
goto cleanup;
41454149
}
@@ -4233,6 +4237,8 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_
42334237
zval *x;
42344238
zval *y;
42354239

4240+
*is_private = false;
4241+
42364242
if ((bn = zend_hash_str_find(Z_ARRVAL_P(data), "curve_name", sizeof("curve_name") - 1)) != NULL &&
42374243
Z_TYPE_P(bn) == IS_STRING) {
42384244
int nid = OBJ_sn2nid(Z_STRVAL_P(bn));
@@ -4257,7 +4263,6 @@ static bool php_openssl_pkey_init_legacy_ec(EC_KEY *eckey, zval *data, bool *is_
42574263
}
42584264

42594265
// The public key 'pnt' can be calculated from 'd' or is defined by 'x' and 'y'
4260-
*is_private = false;
42614266
if ((bn = zend_hash_str_find(Z_ARRVAL_P(data), "d", sizeof("d") - 1)) != NULL &&
42624267
Z_TYPE_P(bn) == IS_STRING) {
42634268
*is_private = true;
@@ -4338,6 +4343,8 @@ static EVP_PKEY *php_openssl_pkey_init_ec(zval *data, bool *is_private) {
43384343
OPENSSL_PKEY_SET_BN(data, x);
43394344
OPENSSL_PKEY_SET_BN(data, y);
43404345

4346+
*is_private = false;
4347+
43414348
if (!ctx || !bld || !curve_name_zv || Z_TYPE_P(curve_name_zv) != IS_STRING) {
43424349
goto cleanup;
43434350
}

0 commit comments

Comments
 (0)