diff options
| author | Johnny Chen <johnny.chen@apple.com> | 2012-05-10 19:24:41 +0000 |
|---|---|---|
| committer | Johnny Chen <johnny.chen@apple.com> | 2012-05-10 19:24:41 +0000 |
| commit | bbc00939f2d819489349f1759f80583e1096578c (patch) | |
| tree | 4c883a57d171789ea5b6b55b3527d42dd645d8cc /lldb/tools/debugserver/source/RNBServices.cpp | |
| parent | 75812f815cf02999705710731bc57b9584dec33e (diff) | |
| download | bcm5719-llvm-bbc00939f2d819489349f1759f80583e1096578c.tar.gz bcm5719-llvm-bbc00939f2d819489349f1759f80583e1096578c.zip | |
Sanity check the return value from SBSCopyApplicationDisplayIdentifiers() before calling CFArrayGetCount() on it.
rdar://problem/11331867
llvm-svn: 156562
Diffstat (limited to 'lldb/tools/debugserver/source/RNBServices.cpp')
| -rw-r--r-- | lldb/tools/debugserver/source/RNBServices.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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<CFStringRef> sbsFrontAppID (::SBSCopyFrontmostApplicationDisplayIdentifier ()); CFReleaser<CFArrayRef> 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++) { |

