diff options
| author | Felipe Pena <felipe@php.net> | 2011-02-15 00:07:26 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2011-02-15 00:07:26 +0000 |
| commit | b58c6f5ede1a4c680c2d687da60ea09d97725950 (patch) | |
| tree | c23f08209fe53e9b4eede91890a8cc6cad163888 | |
| parent | aef95573337a499861238a88d57468786e0b2ed8 (diff) | |
| download | php-git-b58c6f5ede1a4c680c2d687da60ea09d97725950.tar.gz | |
- Fixed crash on unserialize(serialize(new SNMP))
| -rw-r--r-- | ext/snmp/snmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 4f9c41a850..e3cd459526 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -2007,6 +2007,10 @@ static int php_snmp_read_info(php_snmp_object *snmp_object, zval **retval TSRMLS MAKE_STD_ZVAL(*retval); array_init(*retval); + if (snmp_object->session == NULL) { + return SUCCESS; + } + MAKE_STD_ZVAL(val); ZVAL_STRINGL(val, snmp_object->session->peername, strlen(snmp_object->session->peername), 1); add_assoc_zval(*retval, "hostname", val); |
