aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxl/libxl.c
diff options
context:
space:
mode:
authorMatthew Daley <mattjd@gmail.com>2013-09-18 15:37:40 +1200
committerIan Campbell <ian.campbell@citrix.com>2013-09-25 12:42:02 +0100
commitb0be2b126ea75a83a3778b4e1710d248f92cf528 (patch)
treeb2cf2bda53b36a26f4710057e904dbc68271d9e3 /tools/libxl/libxl.c
parent3b8782d95d03b40bfa255b61b224eeef614f09d2 (diff)
downloadxen-b0be2b126ea75a83a3778b4e1710d248f92cf528.tar.gz
xen-b0be2b126ea75a83a3778b4e1710d248f92cf528.tar.bz2
xen-b0be2b126ea75a83a3778b4e1710d248f92cf528.zip
libxl: fix libxl_string_list_length and its only caller
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>
Diffstat (limited to 'tools/libxl/libxl.c')
-rw-r--r--tools/libxl/libxl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
index 0879f2331f..ca24ca37cd 100644
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -202,7 +202,7 @@ int libxl_string_list_length(const libxl_string_list *psl)
{
if (!psl) return 0;
int i = 0;
- while (*psl++) i++;
+ while ((*psl)[i]) i++;
return i;
}