Signed-off-by: Sven Baars sven.wine@gmail.com --- NULL is returned when !ret, so this part is never reached.
dlls/secur32/schannel_gnutls.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
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; }
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.