forked from OSchip/llvm-project
Return false from FileSpec::GetPath early instead of making the return value
dependent on the last byte of the buffer, which could be unitialized. llvm-svn: 106417
This commit is contained in:
parent
e1ce369628
commit
ae39fc196b
|
@ -442,6 +442,10 @@ FileSpec::GetPath(char *path, size_t max_path_length) const
|
|||
{
|
||||
strncpy (path, filename, max_path_length);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Any code paths that reach here assume that strncpy, or a similar function was called
|
||||
// where any remaining bytes will be filled with NULLs and that the string won't be
|
||||
|
|
Loading…
Reference in New Issue