From: Jim Meyering Date: Tue, 15 Dec 2009 18:08:49 +0000 (+0100) Subject: esx_util.c: avoid NULL deref for invalid inputs X-Git-Tag: v0.7.5~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa479727ff42e26a4b1b9af1dab84df5737c2030;p=thirdparty%2Flibvirt.git esx_util.c: avoid NULL deref for invalid inputs * src/esx/esx_util.c (esxUtil_ParseDatastoreRelatedPath): Return right away for invalid inputs, rather than using them (which would dereference NULL pointers) in clean-up code. --- diff --git a/src/esx/esx_util.c b/src/esx/esx_util.c index 3e539217b1..35a48e0898 100644 --- a/src/esx/esx_util.c +++ b/src/esx/esx_util.c @@ -277,7 +277,7 @@ esxUtil_ParseDatastoreRelatedPath(virConnectPtr conn, directoryName == NULL || *directoryName != NULL || fileName == NULL || *fileName != NULL) { ESX_ERROR(conn, VIR_ERR_INTERNAL_ERROR, "Invalid argument"); - goto failure; + return -1; } /*