Skip to contentSkip to conversation

New Defects reported by Coverity Scan for XenProject

DISCUSSION Jan Beulich 1 participant 1 message Nov 12 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 13 lines · On 11.11.2026 18:36, [email protected] wrote:

** CID 1706678: Integer handling issues (INTEGER_OVERFLOW)
/xen/arch/x86/efi/efi-boot.h: 38 in edd_put_string()

_____________________________________________________________________________________________
*** CID 1706678: Integer handling issues (INTEGER_OVERFLOW)
/xen/arch/x86/efi/efi-boot.h: 38 in edd_put_string()
32 {
33 for ( ; n && *src; --n )
34 *dst++ = *src++;
35 if ( *src )
36 PrintErrMesg(L"Internal error populating EDD info",
37 EFI_BUFFER_TOO_SMALL);

Quoted 8 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

CID 1706678: Integer handling issues (INTEGER_OVERFLOW)
Expression "n--", where "n" is known to be equal to 18446744073709551615, underflows the type of "n--", which is type "size_t".

38 while ( n-- )
39 *dst++ = ' ';
40 }
41 #define edd_put_string(d, s) edd_put_string(d, ARRAY_SIZE(d), s)
42
43 extern const intpte_t __page_tables_start[], __page_tables_end[];

What is the tool trying to tell us here. Yes, the underflow is real. But how does it matter, when the loop then terminates and n isn't further used after the loop?

Jan