eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit d2ca0c4f18cd0e9a1b14a9b8d471df7960ad178c
parent eddcc4c5b6b5f9a33dae0317860ee43ae217962b
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Fri, 14 Jan 2022 10:32:30 -0600

dpp-util: Avoid potential overflow

When checking that the length is valid, avoid potentially overflowing
'iter->pos + len'

Diffstat:
Msrc/dpp-util.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dpp-util.c b/src/dpp-util.c @@ -297,7 +297,7 @@ bool dpp_attr_iter_next(struct dpp_attr_iter *iter, const uint8_t **data_out) { enum dpp_attribute_type type; - size_t len; + uint16_t len; if (iter->pos + 4 > iter->end) return false; @@ -307,7 +307,7 @@ bool dpp_attr_iter_next(struct dpp_attr_iter *iter, iter->pos += 4; - if (iter->pos + len > iter->end) + if (iter->end - iter->pos < len) return false; *type_out = type;