[PATCH] secur32: Remove dead code (Coverity).

Hans Leidekker hans at codeweavers.com
Wed Feb 20 13:00:00 CST 2019


On Wed, 2019-02-20 at 19:44 +0100, Sven Baars wrote:
> diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c
> index ea116e81da..857b7e7090 100644
> --- a/dlls/secur32/schannel_gnutls.c
> +++ b/dlls/secur32/schannel_gnutls.c
> @@ -602,8 +602,8 @@ static WCHAR *get_key_container_path(const CERT_CONTEXT *ctx)
>      DWORD size;
>      CERT_KEY_CONTEXT keyctx;
>      CRYPT_KEY_PROV_INFO *prov;
> -    WCHAR username[UNLEN + 1], *ret = NULL;
> -    DWORD len = ARRAY_SIZE(username);
> +    WCHAR *ret = NULL;
> +    DWORD len;
>  
>      size = sizeof(keyctx);
>      if (CertGetCertificateContextProperty(ctx, CERT_KEY_CONTEXT_PROP_ID, &keyctx, &size))
> @@ -643,12 +643,6 @@ static WCHAR *get_key_container_path(const CERT_CONTEXT *ctx)
>          heap_free(prov);
>      }
>  
> -    if (!ret && GetUserNameW(username, &len) && (ret = heap_alloc(sizeof(rsabaseW) + len * sizeof(WCHAR))))
> -    {
> -        strcpyW(ret, rsabaseW);
> -        strcatW(ret, username);
> -    }
> -
>      return ret;
>  }

It should be fixed to reach the username fallback instead. I'll send a
patch.




More information about the wine-devel mailing list