From be2ed4dc4aa81af69730ecfa8790bf6fd474cdcf Mon Sep 17 00:00:00 2001 From: Riccardo Magliocchetti Date: Fri, 25 Oct 2013 19:30:08 +0200 Subject: [PATCH] core/snmp: fix usage of pointer outside of scope Reported by Coverity as CID #1112122 --- core/snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/snmp.c b/core/snmp.c index b2ed383f..5cc34ff9 100644 --- a/core/snmp.c +++ b/core/snmp.c @@ -305,6 +305,7 @@ static uint8_t snmp_int_to_snmp(uint64_t snmp_val, uint8_t oid_type, uint8_t * b uint8_t tlen; int i, j; uint8_t *ptr = (uint8_t *) & snmp_val; + int32_t val32 = (int32_t) snmp_val; // check for counter, counter64 or gauge @@ -316,7 +317,6 @@ static uint8_t snmp_int_to_snmp(uint64_t snmp_val, uint8_t oid_type, uint8_t * b } else { tlen = 4; - int32_t val32 = (int32_t) snmp_val; ptr = (uint8_t *) &val32; }