issue 194: reviewed by waylonis

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@195 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
ladderbreaker 2007-07-03 00:09:14 +00:00
parent 3c07b28119
commit 43a81daaba

View file

@ -158,8 +158,9 @@ class DynamicImage {
// Makes local copy of file path to mach-o binary
void InitializeFilePath(char *inFilePath) {
if (inFilePath) {
file_path_ = reinterpret_cast<char*>(malloc(strlen(inFilePath)));
strcpy(file_path_, inFilePath);
size_t path_size = 1 + strlen(inFilePath);
file_path_ = reinterpret_cast<char*>(malloc(path_size));
strlcpy(file_path_, inFilePath, path_size);
} else {
file_path_ = NULL;
}