lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250313165230561l6bijg5xALudLL3FN303g@zte.com.cn>
Date: Thu, 13 Mar 2025 16:52:30 +0800 (CST)
From: <ye.xingchen@....com.cn>
To: <brauner@...nel.org>
Cc: <jeff.johnson@....qualcomm.com>, <jack@...e.cz>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] nls: Fix utf16s_to_utf8s parameter type in declaration and definition

From: YeXingchen <ye.xingchen@....com.cn>

The declaration of utf16s_to_utf8s in the header file uses
different parameter type with definition.

This patch aligns the parameter name in the definition with the
declaration,changing maxout to maxlen, inlen to len to ensure consistency.

Signed-off-by: YeXingchen <ye.xingchen@....com.cn>
---
 fs/nls/nls_base.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fs/nls/nls_base.c b/fs/nls/nls_base.c
index 18d597e49a19..09b6dbc599c9 100644
--- a/fs/nls/nls_base.c
+++ b/fs/nls/nls_base.c
@@ -183,27 +183,27 @@ static inline unsigned long get_utf16(unsigned c, enum utf16_endian endian)
 	}
 }

-int utf16s_to_utf8s(const wchar_t *pwcs, int inlen, enum utf16_endian endian,
-		u8 *s, int maxout)
+int utf16s_to_utf8s(const wchar_t *pwcs, int len, enum utf16_endian endian,
+		u8 *s, int maxlen)
 {
 	u8 *op;
 	int size;
 	unsigned long u, v;

 	op = s;
-	while (inlen > 0 && maxout > 0) {
+	while (len > 0 && maxlen > 0) {
 		u = get_utf16(*pwcs, endian);
 		if (!u)
 			break;
 		pwcs++;
-		inlen--;
+		len--;
 		if (u > 0x7f) {
 			if ((u & SURROGATE_MASK) == SURROGATE_PAIR) {
 				if (u & SURROGATE_LOW) {
 					/* Ignore character and move on */
 					continue;
 				}
-				if (inlen <= 0)
+				if (len <= 0)
 					break;
 				v = get_utf16(*pwcs, endian);
 				if ((v & SURROGATE_MASK) != SURROGATE_PAIR ||
@@ -214,18 +214,18 @@ int utf16s_to_utf8s(const wchar_t *pwcs, int inlen, enum utf16_endian endian,
 				u = PLANE_SIZE + ((u & SURROGATE_BITS) << 10)
 						+ (v & SURROGATE_BITS);
 				pwcs++;
-				inlen--;
+				len--;
 			}
-			size = utf32_to_utf8(u, op, maxout);
+			size = utf32_to_utf8(u, op, maxlen);
 			if (size == -1) {
 				/* Ignore character and move on */
 			} else {
 				op += size;
-				maxout -= size;
+				maxlen -= size;
 			}
 		} else {
 			*op++ = (u8) u;
-			maxout--;
+			maxlen--;
 		}
 	}
 	return op - s;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ