]> git.99rst.org Git - openwrt-packages.git/commit
olsrd: initialize the LQ multiplier list pointer in the ubus handler
authorJosef Schlehofer <redacted>
Thu, 6 Aug 2026 10:39:35 +0000 (12:39 +0200)
committerNick Hainke <redacted>
Thu, 13 Aug 2026 21:21:19 +0000 (23:21 +0200)
commitf33d1d1f1ff6df97f92288bb8dd466ea6381c37e
treeb9c680d7f458631e1b80759b4f9131f08af101ef
parentd4c843ea2fd80a91ba736b556750aac829130b8d
olsrd: initialize the LQ multiplier list pointer in the ubus handler

The ubus add_interface handler allocates a struct olsr_lq_mult with
malloc() and assigns only ->addr and ->value, leaving ->next
uninitialized before the node is published into cnf->lq_mult. olsrd
walks that list with

    for (mult = cnf->lq_mult; mult != NULL; mult = mult->next)

so the first traversal follows an indeterminate pointer.

Chain the new node onto the existing list, which is what the
configuration file parser does for LinkQualityMult in
src/cfgparser/oparse.y. This also makes the orig_lq_mult_cnt++ on
the next line consistent, since the entry really is prepended to the
list instead of replacing it.

Reported-by: openwrt-ai[bot]
Signed-off-by: Josef Schlehofer <redacted>
Co-authored-by: Claude Fable 5 <redacted>
net/olsrd/src/src/ubus.c
git clone https://git.99rst.org/PROJECT