]> xenbits.xensource.com Git - people/aperard/xtf.git/commitdiff
CodeQL: Two trivial fixes
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Apr 2021 14:16:07 +0000 (15:16 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 19 Apr 2021 14:16:07 +0000 (15:16 +0100)
 * xsa-173: Short global name
 * vsnprintf.c: Suspicious 'sizeof' use

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
common/libc/vsnprintf.c
tests/xsa-173/main.c

index c907d42ba0f52815f77fcae96062c0eda0c23960..ab769297a002d218a004ac0c200c105adfe4fb56 100644 (file)
@@ -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;
     }
 
index 14a1ce4edbcd18338012893535c626934ceb7b09..d9d387beccf6264dd0bdc63f4861381e1e1e4535 100644 (file)
@@ -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)
 {