[libvirt] [PATCH 2/3] security_dac: Avoid segfault when no label is requested
Eric Blake
eblake at redhat.com
Tue Aug 28 17:23:49 UTC 2012
On 08/28/2012 09:51 AM, Peter Krempa wrote:
> When no DAC "label" was requested for a domain the DAC manager tried to
> strdup a NULL string causing a segfault.
> ---
> src/security/security_dac.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/security/security_dac.c b/src/security/security_dac.c
> index 925498f..4162e26 100644
> --- a/src/security/security_dac.c
> +++ b/src/security/security_dac.c
> @@ -890,6 +890,7 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
> break;
> case VIR_DOMAIN_SECLABEL_NONE:
> /* no op */
> + return 0;
> break;
The 'break' is now dead code, and can be deleted.
--
Eric Blake eblake at redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120828/9658827d/attachment-0001.sig>
More information about the libvir-list
mailing list