From 7f1ba5f7df5b7b36c500d9e363b24b21bae0f339 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 28 Jun 2016 15:56:39 +0100 Subject: [PATCH] Replaced unsafe strcpy --- src/osgPlugins/txp/trpage_rarchive.cpp | 4 +++- src/osgPlugins/txp/trpage_readbuf.cpp | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/osgPlugins/txp/trpage_rarchive.cpp b/src/osgPlugins/txp/trpage_rarchive.cpp index 367fd2cd3..6f5afdca1 100644 --- a/src/osgPlugins/txp/trpage_rarchive.cpp +++ b/src/osgPlugins/txp/trpage_rarchive.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #include @@ -538,7 +539,8 @@ void trpgrImageHelper::Init(trpgEndian inNess,char *inDir, const trpgMatTable &inMatTable,const trpgTexTable &inTexTable,bool sepGeoTyp) { ness = inNess; - strcpy(dir,inDir); + osgDB::stringcopyfixedsize(dir,inDir); + separateGeoTyp = sepGeoTyp; matTable = &inMatTable; texTable = &inTexTable; diff --git a/src/osgPlugins/txp/trpage_readbuf.cpp b/src/osgPlugins/txp/trpage_readbuf.cpp index 8cdd2a6a1..49ff41815 100644 --- a/src/osgPlugins/txp/trpage_readbuf.cpp +++ b/src/osgPlugins/txp/trpage_readbuf.cpp @@ -14,6 +14,7 @@ */ #include +#include #include #include @@ -593,8 +594,8 @@ trpgrAppFileCache::trpgrAppFileCache(const char *inPre,const char *inExt,int noF void trpgrAppFileCache::Init(const char *inPre,const char *inExt,int noFiles) { - strcpy(baseName,inPre); - strcpy(ext,inExt); + osgDB::stringcopyfixedsize(baseName,inPre); + osgDB::stringcopyfixedsize(ext,inExt); files.resize(noFiles); timeCount = 0;