Commit f5beab05 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

use strncpy() to limit copy-size

CID:27943
CID:27944
parent 514c520d
......@@ -116,7 +116,8 @@ void multimodel :: open(const std::string&filename, int baseModel, int topModel,
}
preName[i] = '\0';
strcpy(postName, &(strPtr[i+1]));
strncpy(postName, &(strPtr[i+1]), 255);
postName[255]='\0';
// need to figure out how many filenames there are to load
int numModels = (topModel + 1 - baseModel) / skipRate;
......
......@@ -129,7 +129,8 @@ void pix_multiimage :: openMess(t_symbol *filename, int baseImage, int topImage,
}
preName[i] = '\0';
strcpy(postName, &(strPtr[i+1]));
strncpy(postName, &(strPtr[i+1]), 255);
postName[255]='\0';
// need to figure out how many filenames there are to load
m_numImages = (topImage + 1 - baseImage) / skipRate;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment