diff --git a/azure/apt.yml b/azure/apt.yml index e8da9b001d3ee..703e5753d3c40 100644 --- a/azure/apt.yml +++ b/azure/apt.yml @@ -35,8 +35,11 @@ steps: libsodium-dev \ libargon2-0-dev \ libmm-dev \ + libsnmp-dev \ postgresql \ postgresql-contrib \ + snmpd \ + snmp-mibs-downloader \ llvm \ ${{ parameters.packages }} displayName: 'APT' diff --git a/azure/configure.yml b/azure/configure.yml index e9e49bf98acb6..fd0191528bef6 100644 --- a/azure/configure.yml +++ b/azure/configure.yml @@ -56,6 +56,7 @@ steps: --with-mhash \ --with-sodium \ --enable-dba \ + --with-snmp \ --enable-werror \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d diff --git a/azure/setup.yml b/azure/setup.yml index 523bb3b401436..825ca4d5f6c01 100644 --- a/azure/setup.yml +++ b/azure/setup.yml @@ -10,4 +10,10 @@ steps: displayName: 'Setup' - script: ./azure/setup-slapd.sh displayName: 'Configure slapd' + - script: | + set -e + sudo cp ext/snmp/tests/snmpd.conf /etc/snmp + sudo cp ext/snmp/tests/bigtest /etc/snmp + sudo service snmpd restart + displayName: 'Configure snmpd' diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 44c9c98e71a3c..3305565f79ea8 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -1082,7 +1082,7 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version) { zend_string *oid_str, *type_str = NULL, *value_str = NULL; HashTable *oid_ht, *type_ht = NULL, *value_ht = NULL; - char *a1, *a2, *a3, *a4, *a5, *a6, *a7; + char *a1 = NULL, *a2 = NULL, *a3 = NULL, *a4 = NULL, *a5 = NULL, *a6 = NULL, *a7 = NULL; size_t a1_len, a2_len, a3_len, a4_len, a5_len, a6_len, a7_len; zend_bool use_orignames = 0, suffix_keys = 0; zend_long timeout = SNMP_DEFAULT_TIMEOUT;