diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-21 14:36:20 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2010-06-21 14:36:20 +0000 |
| commit | ae39fc196b26f39eaa70b27481056ef69bc766b3 (patch) | |
| tree | 43c5a1ed68561620908dd3516e7291be608977e9 /lldb/source/Core | |
| parent | e1ce369628527d3581ddc6e8308bc82a5044757a (diff) | |
| download | bcm5719-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.cpp | 4 |
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 |

