• Ronnie Sahlberg's avatar
    cifs: avoid extra calls in posix_info_parse · ca38fabc
    Ronnie Sahlberg authored
    In posix_info_parse() we call posix_info_sid_size twice for each of the owner and the group
    sid. The first time to check that it is valid, i.e. >= 0 and the second time
    to just pass it in as a length to memcpy().
    As this is a pure function we know that it can not be negative the second time and this
    is technically a false warning in coverity.
    However, as it is a pure function we are just wasting cycles by calling it a second time.
    Record the length from the first time we call it and save some cycles as well as make
    Coverity happy.
    
    Addresses-Coverity-ID: 1491379 ("Argument can not be negative")
    Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
    Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
    ca38fabc
smb2pdu.c 151 KB