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)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 27 May 2020 14:08:26 +0000 (10:08 -0400)
commit118917d696dc59fd3e1741012c2f9db2294bed6f
treeeaa2fe131df0726d0cd0c0c94387d75ded15849f
parent00a7a00e2d2fc2ebbaf2c3ef25427ae13e0f94da
net: sunrpc: Fix off-by-one issues in 'rpc_ntop6'

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>
net/sunrpc/addr.c