]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix bad libbxo format strings in jls
authorarichardson <arichardson@FreeBSD.org>
Wed, 4 Nov 2020 14:31:52 +0000 (14:31 +0000)
committerarichardson <arichardson@FreeBSD.org>
Wed, 4 Nov 2020 14:31:52 +0000 (14:31 +0000)
commit29c9e2a156c2b563084074124e2656ab198fe102
tree76ed6f43d5e16ce1eeac112c9a4745087836660b
parent21998f7f51e06bc6bdeff43689a1c8f6665bb843
Fix bad libbxo format strings in jls

The existing format string for the empty case was trying to read varargs
values that weren't passed to xo_emit. This appears to work on x86 (since
the next argument is probably a pointer an empty string), but for CHERI
we can bound variadic arguments and detect a read past the end.

While touching these lines also use the libxo 'a' modifier to avoid having to
construct the libxo format string using asprintf.

Found by: CHERI
Reviewed By: allanjude
Differential Revision: https://reviews.freebsd.org/D26885
usr.sbin/jls/jls.c