rem: memcpy(&outbuf[dataOffset], readbuf, bytesRead);
add: memcpy(&outbuf[dataOffset], readbuf, (size_t)bytesRead);
context: DbProxyCopyToRemoteFile(Ns_DbHandle *dbhandle, char *srcFile, char *remoteFileName,    char *errbuf){    int  status = NS_ERROR;    char remoteFdStr[4];    char readbuf[FILE_IOSIZE];    char outbuf[FILE_IOSIZE + 128];    char respbuf[RSP_BUFSIZE];    char remoteOpenParams[512];    int  dataOffset;    int  bytesRead;    int  localSrcFd = -1;    int  fileLoc;    int  done = 0;    remoteFdStr[0] = '\0';    sprintf(remoteOpenParams, "%d%c%s", O_RDWR, ARG_TOKEN_DELIMITER,        remoteFileName);    if ((localSrcFd = open(srcFile, O_RDONLY, 0)) < 0) {        sprintf(errbuf, "open on %s failed: %s", srcFile, strerror(errno));    } else if (DbProxySend(dbhandle, OpenF, remoteOpenParams,            strlen(remoteOpenParams)) != NS_OK) {        sprintf(errbuf, "Can't send OpenFcommand to Proxy Daemon");    } else if (DbProxyGetString(dbhandle, respbuf, RSP_BUFSIZE) != NS_OK) {        sprintf(errbuf, "Can't get OpenF status response from Proxy Daemon");    } else if (strcasecmp(respbuf, OK_STATUS) != 0) {        strcpy(errbuf, respbuf);    } else if (DbProxyGetString(dbhandle, respbuf, RSP_BUFSIZE) != NS_OK) {        sprintf(errbuf, "Can't get OpenF fd response from Proxy Daemon");    } else {        strcpy(remoteFdStr, respbuf);        /*         * we now have a local (source) and remote (destination) file         * descriptor         */        fileLoc = 0;        status = NS_OK;        while (!done && status == NS_OK) {            status = NS_ERROR;            if ((bytesRead = read(localSrcFd, readbuf, FILE_IOSIZE)) > 0) {                /*		 * package data for transmission		 */                dataOffset = sprintf(outbuf, "%s%c%d%c%d%c",				     remoteFdStr, ARG_TOKEN_DELIMITER,				     fileLoc, ARG_TOKEN_DELIMITER,				     bytesRead, ARG_TOKEN_DELIMITER);                memcpy(&outbuf[dataOffset], readbuf, bytesRead);                if (DbProxySend(dbhandle, WriteF, outbuf,                        dataOffset + bytesRead) != NS_OK) {                    sprintf(errbuf, "Remote write failure, file offset=%d",			    fileLoc);                } else if (DbProxyGetString(dbhandle, respbuf,					    RSP_BUFSIZE) != NS_OK) {		                        sprintf(errbuf, "Can't get WriteF status response "			    "from Proxy Daemon");                } else if (strcasecmp(respbuf, OK_STATUS) != 0) {                    strcpy(errbuf, respbuf);                } else {                    status = NS_OK;                    fileLoc += bytesRead;                }            } else if (bytesRead == 0) {                status = NS_OK;                done = 1;            } else {                sprintf(errbuf, "read on %s failed: %s",			srcFile, strerror(errno));            }        }    }    if (localSrcFd != -1) {        close(localSrcFd);    }    if (remoteFdStr[0] != '\0') {	/*	 * close remote fd	 */	        status = NS_ERROR;        if (DbProxySend(dbhandle, CloseF, remoteFdStr,                strlen(remoteFdStr)) != NS_OK) {	                sprintf(errbuf, "Can't send CloseF command to Proxy Daemon");        } else if (DbProxyGetString(dbhandle, respbuf, RSP_BUFSIZE) != NS_OK) {            sprintf(errbuf,		    "Can't get CloseF status response from Proxy Daemon");        } else if (strcasecmp(respbuf, OK_STATUS) != 0) {            strcpy(errbuf, respbuf);        } else {            status = NS_OK;        }    }        return status;}