prev_plen is only accessed on the 2nd round through the loop.
authorflorian <florian@openbsd.org>
Sun, 2 Jun 2024 17:44:06 +0000 (17:44 +0000)
committerflorian <florian@openbsd.org>
Sun, 2 Jun 2024 17:44:06 +0000 (17:44 +0000)
Static analysers don't understand this. So give it a value
to shut them up.
Reported by jsg

sbin/dhcp6leased/parse.y

index 2ed076a..da2a095 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: parse.y,v 1.3 2024/06/02 17:26:54 florian Exp $       */
+/*     $OpenBSD: parse.y,v 1.4 2024/06/02 17:44:06 florian Exp $       */
 
 /*
  * Copyright (c) 2018, 2024 Florian Obser <florian@openbsd.org>
@@ -792,7 +792,7 @@ addressing_plan(struct iface_ia_conf *ia_conf)
 {
        struct iface_pd_conf    *pd_conf;
        uint64_t                *p, lo_counter, hi_counter, lo_shift, hi_shift;
-       int                      prev_plen;
+       int                      prev_plen = -1;
 
        lo_counter = hi_counter = 0;