[Lldb-commits] [lldb] r106417 - /lldb/trunk/source/Core/FileSpec.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon Jun 21 07:36:20 PDT 2010
Author: d0k
Date: Mon Jun 21 09:36:20 2010
New Revision: 106417
URL: http://llvm.org/viewvc/llvm-project?rev=106417&view=rev
Log:
Return false from FileSpec::GetPath early instead of making the return value
dependent on the last byte of the buffer, which could be unitialized.
Modified:
lldb/trunk/source/Core/FileSpec.cpp
Modified: lldb/trunk/source/Core/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FileSpec.cpp?rev=106417&r1=106416&r2=106417&view=diff
==============================================================================
--- lldb/trunk/source/Core/FileSpec.cpp (original)
+++ lldb/trunk/source/Core/FileSpec.cpp Mon Jun 21 09:36:20 2010
@@ -442,6 +442,10 @@
{
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
More information about the lldb-commits
mailing list