Prevent a double free by assigning the new keymap and corresponding size
authoranton <anton@openbsd.org>
Thu, 30 Dec 2021 06:55:11 +0000 (06:55 +0000)
committeranton <anton@openbsd.org>
Thu, 30 Dec 2021 06:55:11 +0000 (06:55 +0000)
commit61c8c0f0fd3e5e422eda433673a010dd0da6b046
tree4f8315c8290c8eb7cfc90ddbf7b51bc1ad31d346
parent5a2b798a48f6f7fee41ae70f800ffa8925da125c
Prevent a double free by assigning the new keymap and corresponding size
after the allocation and initialization is done. Otherwise, a race is
possible if malloc ends up sleeping.

ok sashan@

Reported-by: syzbot+7f8224e9f1a3487caf25@syzkaller.appspotmail.com
sys/dev/wscons/wskbd.c
sys/dev/wscons/wskbdutil.c
sys/dev/wscons/wsksymvar.h