The wrong amount of indirections were being taken in
libxl_string_list_length, and its only caller was miscounting the amount
of initial non-list arguments, seemingly since the initial commit
(
599c784).
This has been seen and reported in the wild (##xen):
< Trixboxer> Hi, any idea why would I get
< Trixboxer> xl: libxl_bootloader.c:42: bootloader_arg: Assertion `bl->nargs < bl->argsspace' failed.
< Trixboxer> 4.2.2-23.el6
Coverity-ID:
1054954
Signed-off-by: Matthew Daley <mattjd@gmail.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
{
if (!psl) return 0;
int i = 0;
- while (*psl++) i++;
+ while ((*psl)[i]) i++;
return i;
}
{
const libxl_domain_build_info *info = bl->info;
- bl->argsspace = 7 + libxl_string_list_length(&info->u.pv.bootloader_args);
+ bl->argsspace = 9 + libxl_string_list_length(&info->u.pv.bootloader_args);
GCNEW_ARRAY(bl->args, bl->argsspace);