]> git.baikalelectronics.ru Git - 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)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 27 May 2020 14:08:26 +0000 (10:08 -0400)
commit008462bedf8dbc46cfd9bb396b1ff5e00e1f45a6
treeeaa2fe131df0726d0cd0c0c94387d75ded15849f
parent63bf55d960a6c1ab18a1e7305af7db95ce889b0b
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