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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <4zlmy3qwneijnrsbygfr2wbsnvdvcgvjyvudqnuxq5zvwmyaof@tarta.nabijaczleweli.xyz>
Date: Sat, 16 Dec 2023 00:53:45 +0100
From: 
	Ahelenia Ziemiańska <nabijaczleweli@...ijaczleweli.xyz>
Cc: Trond Myklebust <trond.myklebust@...merspace.com>, 
	Anna Schumaker <anna@...nel.org>, Chuck Lever <chuck.lever@...cle.com>, 
	Jeff Layton <jlayton@...nel.org>, Neil Brown <neilb@...e.de>, Olga Kornievskaia <kolga@...app.com>, 
	Dai Ngo <Dai.Ngo@...cle.com>, Tom Talpey <tom@...pey.com>, 
	"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, 
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, linux-nfs@...r.kernel.org, 
	netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] net: sunrpc: sizeof('\0') is 4, not 1

To make it self-documenting, the referenced commit added the space
for the null terminator as sizeof('\0'). The message elaborates on
why only one byte is needed, so this is clearly a mistake.
Spell it as 1 /* NUL */ instead.

This is the only result for git grep "sizeof.'" in the tree.

Fixes: commit 1e360a60b24a ("SUNRPC: Address  buffer overrun in
 rpc_uaddr2sockaddr()")
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@...ijaczleweli.xyz>
---
 net/sunrpc/addr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/sunrpc/addr.c b/net/sunrpc/addr.c
index d435bffc6199..c4ba342f6866 100644
--- a/net/sunrpc/addr.c
+++ b/net/sunrpc/addr.c
@@ -311,7 +311,7 @@ size_t rpc_uaddr2sockaddr(struct net *net, const char *uaddr,
 			  const size_t uaddr_len, struct sockaddr *sap,
 			  const size_t salen)
 {
-	char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')];
+	char *c, buf[RPCBIND_MAXUADDRLEN + 1 /* NUL */];
 	u8 portlo, porthi;
 	unsigned short port;
 

base-commit: 26aff849438cebcd05f1a647390c4aa700d5c0f1
-- 
2.39.2

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ