[libvirt] [PATCH 5/3] rpc: correctly process sasl whitelist globs

Laine Stump laine at laine.org
Tue Aug 2 19:20:40 UTC 2011


On 08/02/2011 03:06 PM, Eric Blake wrote:
> Detected by Coverity.  We want to compare the result of fnmatch 'rv',
> not our pre-set return value 'ret'.
>
> * src/rpc/virnetsaslcontext.c (virNetSASLContextCheckIdentity):
> Check correct variable.
> ---
>   src/rpc/virnetsaslcontext.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/rpc/virnetsaslcontext.c b/src/rpc/virnetsaslcontext.c
> index a0752dd..ef36e2c 100644
> --- a/src/rpc/virnetsaslcontext.c
> +++ b/src/rpc/virnetsaslcontext.c
> @@ -130,11 +130,11 @@ int virNetSASLContextCheckIdentity(virNetSASLContextPtr ctxt,
>           int rv = fnmatch (*wildcards, identity, 0);
>           if (rv == 0) {
>               ret = 1;
>               goto cleanup; /* Succesful match */
>           }
> -        if (ret != FNM_NOMATCH) {
> +        if (rv != FNM_NOMATCH) {
>               virNetError(VIR_ERR_INTERNAL_ERROR,
>                           _("Malformed TLS whitelist regular expression '%s'"),
>                           *wildcards);
>               goto cleanup;
>           }


ACK.




More information about the libvir-list mailing list