VM: fix string copying to not use PATH_MAX here
parent
e2e3b448ee
commit
83e1ee5084
|
@ -20,8 +20,8 @@ const char* default_image_path() {
|
|||
return "factor.image";
|
||||
|
||||
int len = strlen(path);
|
||||
char* new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
|
||||
memcpy(new_path, path, len + 1);
|
||||
char* new_path = new char[len + SUFFIX_LEN + 1];
|
||||
memcpy(new_path, path, len);
|
||||
memcpy(new_path + len, SUFFIX, SUFFIX_LEN + 1);
|
||||
free(const_cast<char*>(path));
|
||||
return new_path;
|
||||
|
|
Loading…
Reference in New Issue