From 81da888c22ab85754b82982b1ef2b49e2f289b3a Mon Sep 17 00:00:00 2001 From: thilo Date: Tue, 25 Mar 2008 21:45:20 +0000 Subject: Commit patch from Jacques Boscq, which will prohibit the calling of memcpy with src=dest git-svn-id: svn://svn.icculus.org/quake3/trunk@1278 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/files.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'code/qcommon') diff --git a/code/qcommon/files.c b/code/qcommon/files.c index ba50222..5e001ed 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1092,8 +1092,10 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF temp = zfi->file; // set the file position in the zip file (also sets the current file info) unzSetCurrentFileInfoPosition(pak->handle, pakFile->pos); - // copy the file info into the unzip structure - Com_Memcpy( zfi, pak->handle, sizeof(unz_s) ); + if ( zfi != pak->handle ) { + // copy the file info into the unzip structure + Com_Memcpy( zfi, pak->handle, sizeof(unz_s) ); + } // we copy this back into the structure zfi->file = temp; // open the file in the zip -- cgit v1.2.3