]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
net: sunrpc: Fix off-by-one issues in 'rpc_ntop6'
authorFedor Tokarev <ftokarev@gmail.com>
Sat, 28 Mar 2020 11:56:55 +0000 (14:56 +0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commitdad67de2159c8f705c4602e99fab35f6918ec81c
tree5fb671ce6376d78ac45c887e728c8e39cd930e15
parent3c0b436b67962cdbc754cc7b0f08fbb76a0384ab
net: sunrpc: Fix off-by-one issues in 'rpc_ntop6'

BugLink: https://bugs.launchpad.net/bugs/1885322
[ Upstream commit 118917d696dc59fd3e1741012c2f9db2294bed6f ]

Fix off-by-one issues in 'rpc_ntop6':
 - 'snprintf' returns the number of characters which would have been
   written if enough space had been available, excluding the terminating
   null byte. Thus, a return value of 'sizeof(scopebuf)' means that the
   last character was dropped.
 - 'strcat' adds a terminating null byte to the string, thus if len ==
   buflen, the null byte is written past the end of the buffer.

Signed-off-by: Fedor Tokarev <ftokarev@gmail.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
net/sunrpc/addr.c