From: Volker Lendecke Date: Mon, 1 Sep 2008 11:46:27 +0000 (+0200) Subject: Fix Coverity ID 587 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9daea0ccfdda58450be3c9a9a94c016f5900c319;p=thirdparty%2Fsamba.git 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 --- diff --git a/source/smbd/process.c b/source/smbd/process.c index 332a2e4da3a..b2d19e11e38 100644 --- a/source/smbd/process.c +++ b/source/smbd/process.c @@ -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,