eiwd

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

commit 3e0e31544e3706ba8222986407c0f1787e7d21d8
parent 49b9eae18c3e8cb5876c40acc4cf46489e1f09f0
Author: James Prestwood <prestwoj@gmail.com>
Date:   Wed, 25 Oct 2023 15:42:24 -0700

unit: correct memcpy overrun in test-dpp

The memcpy in HEX2BUF was copying the length of the buffer that was
passed in, not the actual length of the converted hexstring. This
test was segfaulting in the Alpine CI which uses clang/musl.

Diffstat:
Munit/test-dpp.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/unit/test-dpp.c b/unit/test-dpp.c @@ -183,8 +183,9 @@ const char *r_asn1 = "3039301306072a8648ce3d020106082a8648ce3d0301070322000209c5 "4df9fd25a045201885c39cc5cfae397ddaeda957dec57fa0e3503f"; #define HEX2BUF(s, buf, _len) { \ - unsigned char *_tmp = l_util_from_hexstring(s, NULL); \ - memcpy(buf, _tmp, _len); \ + size_t _len_out; \ + unsigned char *_tmp = l_util_from_hexstring(s, &_len_out); \ + memcpy(buf, _tmp, _len_out); \ l_free(_tmp); \ }