summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-06-21 14:36:20 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-06-21 14:36:20 +0000
commitae39fc196b26f39eaa70b27481056ef69bc766b3 (patch)
tree43c5a1ed68561620908dd3516e7291be608977e9 /lldb/source/Core
parente1ce369628527d3581ddc6e8308bc82a5044757a (diff)
downloadbcm5719-llvm-ae39fc196b26f39eaa70b27481056ef69bc766b3.tar.gz
bcm5719-llvm-ae39fc196b26f39eaa70b27481056ef69bc766b3.zip
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
Diffstat (limited to 'lldb/source/Core')
-rw-r--r--lldb/source/Core/FileSpec.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lldb/source/Core/FileSpec.cpp b/lldb/source/Core/FileSpec.cpp
index 4fef5cd5b36..91ad6b04351 100644
--- a/lldb/source/Core/FileSpec.cpp
+++ b/lldb/source/Core/FileSpec.cpp
@@ -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
OpenPOWER on IntegriCloud