]> git.puffer.fish Git - matthieu/frr.git/commit
lib: fix infinite loop in __darr_in_vsprintf
authorIgor Ryzhov <iryzhov@nfware.com>
Mon, 4 Mar 2024 18:41:41 +0000 (20:41 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Tue, 5 Mar 2024 00:08:30 +0000 (02:08 +0200)
commitcb6032d6b3d9fc1198f61ac343ec22b456a8896e
tree425d802efd2d5539638744ed7583035ede206235
parentee0c1cc1e4b87bde73f1eba3212ab93b1c379c6c
lib: fix infinite loop in __darr_in_vsprintf

`darr_avail` returns the available capacity excluding the already
existing terminating NULL byte. Take this into account when using
`darr_avail`. Otherwise, if the error length is a power of 2, the
capacity is never enough and the function stucks in an infinite loop.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
lib/darr.c