dhcpv6-ia: fix a crash when static lease isn't configured
Quoting from https://github.com/openwrt/odhcpd/issues/321:
[71802.880039] odhcpd[22696]: segfault at 78...
Quoting from https://forum.openwrt.org/t/odhcpd-crash-loop-when-receiving-packet/243015/69:
[ 77.761062] odhcpd[2075]: segfault at 78...
0x78 is the offset of duid_count in struct lease_cfg, so if lease_cfg is
null, we'd end up reading from address 0x78 when trying to read
lease_cfg->duid_count.
This should fix the issue. Thanks to @klipz in the forums for giving me
SSH access to an awesome test sandbox.
Closes: https://github.com/openwrt/odhcpd/issues/321
Signed-off-by: David Härdeman <[email protected]>
Link: https://github.com/openwrt/odhcpd/pull/328
Signed-off-by: Álvaro Fernández Rojas <[email protected]>