Dmitry Timoshkov : kerberos: Slightly simplify name_sspi_to_gss.

Alexandre Julliard julliard at winehq.org
Thu Feb 8 15:33:08 CST 2018


Module: wine
Branch: master
Commit: 0d44fc790492afb616727ca2f1991c9f193468c6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0d44fc790492afb616727ca2f1991c9f193468c6

Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date:   Thu Feb  8 09:42:43 2018 +0800

kerberos: Slightly simplify name_sspi_to_gss.

Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kerberos/krb5_ap.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dlls/kerberos/krb5_ap.c b/dlls/kerberos/krb5_ap.c
index e3ede45..99673b0 100644
--- a/dlls/kerberos/krb5_ap.c
+++ b/dlls/kerberos/krb5_ap.c
@@ -748,10 +748,9 @@ static SECURITY_STATUS name_sspi_to_gss( const UNICODE_STRING *name_str, gss_nam
     gss_OID type = GSS_C_NO_OID; /* FIXME: detect the appropriate value for this ourselves? */
     gss_buffer_desc buf;
 
-    buf.length = WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), NULL, 0, NULL, NULL ) + 1;
+    buf.length = WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), NULL, 0, NULL, NULL );
     if (!(buf.value = heap_alloc( buf.length ))) return SEC_E_INSUFFICIENT_MEMORY;
     WideCharToMultiByte( CP_UNIXCP, 0, name_str->Buffer, name_str->Length / sizeof(WCHAR), buf.value, buf.length, NULL, NULL );
-    buf.length--;
 
     ret = pgss_import_name( &minor_status, &buf, type, name );
     TRACE( "gss_import_name returned %08x minor status %08x\n", ret, minor_status );




More information about the wine-cvs mailing list