Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nfs: use memcpy_and_pad in decode_fh

Use memcpy_and_pad() instead of memcpy() followed by memset() to
simplify decode_fh().

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>

authored by

Thorsten Blum and committed by
Trond Myklebust
43ea7036 8c787b28

+1 -2
+1 -2
fs/nfs/callback_xdr.c
··· 96 96 p = xdr_inline_decode(xdr, fh->size); 97 97 if (unlikely(p == NULL)) 98 98 return htonl(NFS4ERR_RESOURCE); 99 - memcpy(&fh->data[0], p, fh->size); 100 - memset(&fh->data[fh->size], 0, sizeof(fh->data) - fh->size); 99 + memcpy_and_pad(fh->data, sizeof(fh->data), p, fh->size, 0); 101 100 return 0; 102 101 } 103 102