eiwd

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

commit e256cbaba9f352d91e2f18c6c88c89bcf8b8b0b6
parent 30cf1aa376719b9c2e8233bd89975c842eaf46c2
Author: Denis Kenzior <denkenz@gmail.com>
Date:   Fri, 11 Jan 2019 17:10:47 -0600

eapol: Don't memcpy if no extra data

As reported by the sanitizer:

src/eapol.c:574:2: runtime error: null pointer passed as argument 2,
	which is declared to never be null

Diffstat:
Msrc/eapol.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/eapol.c b/src/eapol.c @@ -570,8 +570,10 @@ static struct eapol_key *eapol_create_common( out_frame->key_length = 0; out_frame->key_replay_counter = L_CPU_TO_BE64(key_replay_counter); memcpy(out_frame->key_nonce, snonce, sizeof(out_frame->key_nonce)); + out_frame->key_data_len = L_CPU_TO_BE16(extra_len); - memcpy(out_frame->key_data, extra_data, extra_len); + if (extra_len) + memcpy(out_frame->key_data, extra_data, extra_len); return out_frame; }