From: Andrew Cooper Date: Mon, 19 Apr 2021 14:16:07 +0000 (+0100) Subject: CodeQL: Two trivial fixes X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=b0bc49846c154b79243f39d461a4515804bcaf53;p=people%2Fandrewcoop%2Fxen-test-framework.git CodeQL: Two trivial fixes * xsa-173: Short global name * vsnprintf.c: Suspicious 'sizeof' use Signed-off-by: Andrew Cooper --- diff --git a/common/libc/vsnprintf.c b/common/libc/vsnprintf.c index c907d42..ab76929 100644 --- a/common/libc/vsnprintf.c +++ b/common/libc/vsnprintf.c @@ -265,7 +265,7 @@ static char *pointer( /* Fall back to plain 32/64bit hex integer. */ if ( width == -1 ) { - width = 2 * sizeof(arg); + width = 2 * sizeof(void *); flags |= ZERO; } diff --git a/tests/xsa-173/main.c b/tests/xsa-173/main.c index 14a1ce4..d9d387b 100644 --- a/tests/xsa-173/main.c +++ b/tests/xsa-173/main.c @@ -25,7 +25,7 @@ const char test_title[] = "XSA-173 PoC"; /* New L2 pagetable for the test to manipulate. */ -uint64_t nl2[PAE_L2_PT_ENTRIES] __page_aligned_bss; +static uint64_t nl2[PAE_L2_PT_ENTRIES] __page_aligned_bss; void test_main(void) {