• Benny Halevy's avatar
    nfsd: make nfs4xdr WRITEMEM safe against zero count · 13b1867c
    Benny Halevy authored
    WRITEMEM zeroes the last word in the destination buffer
    for padding purposes, but this must not be done if
    no bytes are to be copied, as it would result
    in zeroing of the word right before the array.
    
    The current implementation works since it's always called
    with non zero nbytes or it follows an encoding of the
    string (or opaque) length which, if equal to zero,
    can be overwritten with zero.
    
    Nevertheless, it seems safer to check for this case.
    Signed-off-by: default avatarBenny Halevy <bhalevy@panasas.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    13b1867c
nfs4xdr.c 68.8 KB