libxl: Avoid realloc(,0) when libxl__xs_directory returns empty list
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 18 Apr 2013 15:27:46 +0000 (16:27 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 12 Nov 2013 17:52:09 +0000 (17:52 +0000)
commit48249a140379b6a66cd32438c344a57fa21e00ed
tree19d09cf376ef1fab72ff0a8fa8660c85d430febb
parent47cb2273b2bfc25279c917d0bb5a67dc2d9266bc
libxl: Avoid realloc(,0) when libxl__xs_directory returns empty list

If the named path is a leaf node, libxl__xs_directory can succeed,
returning non-null, but set *nb to 0.

In three places in libxl this may result in a zero size argument being
passed to malloc() or realloc(), which is not adviseable.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c