From 3af6926c7d79d7553dad55bb439eed1144eaafcd Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 6 Jan 2022 15:25:38 -0600 Subject: [PATCH] gss: Fix sign extension bug (from be708ca3cf) When unsigned char values are shifted, they are promoted to int (unless sizeof(int) == sizeof(char)). This means that the change in be708ca3cf ultimately leads to a sign extension bug. --- lib/gssapi/krb5/import_name.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/gssapi/krb5/import_name.c b/lib/gssapi/krb5/import_name.c index 110ee2b12..ae24e374d 100644 --- a/lib/gssapi/krb5/import_name.c +++ b/lib/gssapi/krb5/import_name.c @@ -171,7 +171,8 @@ import_export_name (OM_uint32 *minor_status, { CompositePrincipal *composite; unsigned char *p; - size_t length, sz; + uint32_t length; + size_t sz; OM_uint32 ret; int is_composite; char *name;