1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

Fix Coverity ID 587

The following test program prints "8" on 64-bit :-)

static void print_size(const char lenbuf[4])
{
        printf("sizeof(lenbuf) = %d\n", (int)sizeof(lenbuf));
}
int main(void)
{
        const char lenbuf[4];
        print_size(lenbuf);
        return 0;
}

Jeremy, please check :-)

Volker
(This used to be commit 9daea0ccfdda58450be3c9a9a94c016f5900c319)
This commit is contained in:
Volker Lendecke 2008-09-01 13:46:27 +02:00 committed by Volker Lendecke
parent 9554f39b12
commit 227718cd1a

View File

@ -164,7 +164,7 @@ static NTSTATUS receive_smb_raw_talloc_partial_read(TALLOC_CTX *mem_ctx,
ssize_t toread;
NTSTATUS status;
memcpy(writeX_header, lenbuf, sizeof(lenbuf));
memcpy(writeX_header, lenbuf, 4);
status = read_socket_with_timeout(
fd, writeX_header + 4,