rem: memcpy(pagePtr->code.len, parse.hdr.string, parse.hdr.length); memcpy(pagePtr->code.base, parse.text.string, parse.text.length);
add: memcpy(pagePtr->code.len, parse.hdr.string, (size_t)parse.hdr.length); memcpy(pagePtr->code.base, parse.text.string, (size_t)parse.text.length);
context: ParseFile(NsInterp *itPtr, char *file, struct stat *stPtr){    Tcl_Interp *interp = itPtr->interp;    Tcl_Encoding encoding;    Tcl_DString utf;    char *page, *buf;    int fd, n, size, trys;    Page *pagePtr;    AdpParse parse;        fd = open(file, O_RDONLY | O_BINARY);    if (fd < 0) {	Tcl_AppendResult(interp, "could not open \"",	    file, "\": ", Tcl_PosixError(interp), NULL);	return NULL;    }    pagePtr = NULL;    buf = NULL;    trys = 0;    do {	/*	 * fstat the open file to ensure it has not changed or been	 * replaced since the original stat.	 */	if (fstat(fd, stPtr) != 0) {	    Tcl_AppendResult(interp, "could not fstat \"", file,	   	"\": ", Tcl_PosixError(interp), NULL);	    goto done;	}    	size = stPtr->st_size;    	buf = ns_realloc(buf, size + 1);	/*	 * Attempt to read +1 byte to catch the file growing.	 */    	n = read(fd, buf, size + 1);    	if (n < 0) {	    Tcl_AppendResult(interp, "could not read \"", file,	    	"\": ", Tcl_PosixError(interp), NULL);	    goto done;	}	if (n != size) {	    /*	     * File is not expected size, rewind and fstat/read again.	     */		    if (lseek(fd, 0, SEEK_SET) != 0) {	    	Tcl_AppendResult(interp, "could not lseek \"", file,	    	    "\": ", Tcl_PosixError(interp), NULL);	        goto done;	    }	    Ns_ThreadYield();	}    } while (n != size && ++trys < 10);    if (n != size) {	Tcl_AppendResult(interp, "inconsistant file: ", file, NULL);    } else {	buf[n] = '\0';	Tcl_DStringInit(&utf);	encoding = Ns_GetFileEncoding(file);	if (encoding == NULL) {	    page = buf;	} else {	    Tcl_ExternalToUtfDString(encoding, buf, n, &utf);	    page = utf.string;	}	NsAdpParse(&parse, itPtr->servPtr, page, 0);	Tcl_DStringFree(&utf);	n = parse.hdr.length + parse.text.length + strlen(file) + 1;	pagePtr = ns_malloc(sizeof(Page) + n);	pagePtr->servPtr = itPtr->servPtr;	pagePtr->refcnt = 0;	pagePtr->evals = 0;	pagePtr->mtime = stPtr->st_mtime;	pagePtr->size = stPtr->st_size;	pagePtr->code.nblocks = parse.code.nblocks;	pagePtr->code.nscripts = parse.code.nscripts;	pagePtr->code.len = (int *) (pagePtr + 1);	pagePtr->code.base = (char *) (pagePtr->code.len + parse.code.nblocks);	pagePtr->file = pagePtr->code.base + parse.text.length;	memcpy(pagePtr->code.len, parse.hdr.string, parse.hdr.length);	memcpy(pagePtr->code.base, parse.text.string, parse.text.length);	strcpy(pagePtr->file, file);	ParseFree(&parse);    }done:    ns_free(buf);    close(fd);    return pagePtr;}