From bbc00939f2d819489349f1759f80583e1096578c Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Thu, 10 May 2012 19:24:41 +0000 Subject: Sanity check the return value from SBSCopyApplicationDisplayIdentifiers() before calling CFArrayGetCount() on it. rdar://problem/11331867 llvm-svn: 156562 --- lldb/tools/debugserver/source/RNBServices.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lldb/tools/debugserver/source/RNBServices.cpp') diff --git a/lldb/tools/debugserver/source/RNBServices.cpp b/lldb/tools/debugserver/source/RNBServices.cpp index 5e793dbf279..9181fddd549 100644 --- a/lldb/tools/debugserver/source/RNBServices.cpp +++ b/lldb/tools/debugserver/source/RNBServices.cpp @@ -36,7 +36,8 @@ ListApplications(std::string& plist, bool opt_runningApps, bool opt_debuggable) CFReleaser sbsFrontAppID (::SBSCopyFrontmostApplicationDisplayIdentifier ()); CFReleaser sbsAppIDs (::SBSCopyApplicationDisplayIdentifiers (opt_runningApps, opt_debuggable)); - CFIndex count = ::CFArrayGetCount (sbsAppIDs.get()); + // Need to check the return value from SBSCopyApplicationDisplayIdentifiers. + CFIndex count = sbsAppIDs.get() ? ::CFArrayGetCount (sbsAppIDs.get()) : 0; CFIndex i = 0; for (i = 0; i < count; i++) { -- cgit v1.2.3