summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-08 20:47:07 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-08 20:47:07 +0000
commitd41fca11af4f821b58cb840ce85127c0cb1ff962 (patch)
treebc9d095f25b9fe331a4d11cdb018db5033529883 /lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
parent03700ded1b80bf1d0e4b2373001b3320ef014e23 (diff)
downloadbcm5719-llvm-d41fca11af4f821b58cb840ce85127c0cb1ff962.tar.gz
bcm5719-llvm-d41fca11af4f821b58cb840ce85127c0cb1ff962.zip
POSIX: fix possible invalid API usage
strcmp cannot be passed a NULL. Add a short-circuiting check to avoid the possible API misuse. llvm-svn: 203358
Diffstat (limited to 'lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp')
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index acc44188f6f..f4b1dd77cff 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -192,7 +192,7 @@ ProcessPOSIX::GetFilePath(
// (/dev/pts). If so, convert to using a different default path
// instead to redirect I/O to the debugger console. This should
// also handle user overrides to /dev/null or a different file.
- if (::strncmp(path, pts_name, ::strlen(pts_name)) == 0)
+ if (!path || ::strncmp(path, pts_name, ::strlen(pts_name)) == 0)
path = default_path;
}
}
OpenPOWER on IntegriCloud