mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-10-29 18:54:03 +00:00
ipv4: Fix potential use uninit var in ip4_addr
The GCC static analyzer (-fanalyzer) can't prove that parts[1] (and parts[2]) are initialized when accessed in the case 3: and case 4: branches of the switch statement. In reality they always are -- the switch value pp - parts + 1 directly corresponds to how many times *pp++ = val executed, so reaching case 3: guarantees parts[0] and parts[1] were written. But the analyzer can't track this pointer-arithmetic relationship.
This commit is contained in:
@@ -147,7 +147,7 @@ ip4addr_aton(const char *cp, ip4_addr_t *addr)
|
||||
u32_t val;
|
||||
u8_t base;
|
||||
char c;
|
||||
u32_t parts[4];
|
||||
u32_t parts[4] = { 0 };
|
||||
u32_t *pp = parts;
|
||||
|
||||
c = *cp;
|
||||
|
||||
Reference in New Issue
Block a user