• S
    fs/cifs: suppress a string overflow warning · bcfb84a9
    Stephen Rothwell 提交于
    A powerpc build of cifs with gcc v8.2.0 produces this warning:
    
    fs/cifs/cifssmb.c: In function ‘CIFSSMBNegotiate’:
    fs/cifs/cifssmb.c:605:3: warning: ‘strncpy’ writing 16 bytes into a region of size 1 overflows the destination [-Wstringop-overflow=]
       strncpy(pSMB->DialectsArray+count, protocols[i].name, 16);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Since we are already doing a strlen() on the source, change the strncpy
    to a memcpy().
    Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
    Signed-off-by: NSteve French <stfrench@microsoft.com>
    bcfb84a9
cifssmb.c 191.1 KB