mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
This commit is contained in:
commit
3ee8b3929e
2 changed files with 22 additions and 0 deletions
|
@ -1660,6 +1660,10 @@ PHP_METHOD(SNMP, setSecurity)
|
|||
zend_string *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL, *a5 = NULL, *a6 = NULL, *a7 = NULL;
|
||||
|
||||
snmp_object = Z_SNMP_P(object);
|
||||
if (!snmp_object->session) {
|
||||
zend_throw_error(NULL, "Invalid or uninitialized SNMP object");
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|SSSSSS", &a1, &a2, &a3, &a4,&a5, &a6, &a7) == FAILURE) {
|
||||
RETURN_THROWS();
|
||||
|
|
18
ext/snmp/tests/gh17330.phpt
Normal file
18
ext/snmp/tests/gh17330.phpt
Normal file
|
@ -0,0 +1,18 @@
|
|||
--TEST--
|
||||
SNMP::setSecurity() segfault when the object had been closed.
|
||||
--EXTENSIONS--
|
||||
snmp
|
||||
--CREDITS--
|
||||
YuanchengJiang
|
||||
--FILE--
|
||||
<?php
|
||||
$session = new SNMP(SNMP::VERSION_2c, "localhost", 'timeout_community_432');
|
||||
$session->close();
|
||||
try {
|
||||
$session->setSecurity('authPriv', 'MD5', '', 'AES', '');
|
||||
} catch(Error $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
Invalid or uninitialized SNMP object
|
Loading…
Add table
Add a link
Reference in a new issue