From 075926978e54d4b06306c7eb10cd48879f56c683 Mon Sep 17 00:00:00 2001 From: Mike Magruder Date: Thu, 16 May 2013 10:20:21 -0700 Subject: [PATCH] Segfault when calling hphpd_break() with no debugger attached A call to hphpd_break() with no debugger attached, from a command-line run (no request), with debugging enabled (not normally true, but can be true if you use something besides cli.hdf), will segfault every time. Simple fix for a high hit-count crash. --- hphp/runtime/eval/debugger/debugger.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hphp/runtime/eval/debugger/debugger.cpp b/hphp/runtime/eval/debugger/debugger.cpp index b67000cbb..1c3aeb205 100644 --- a/hphp/runtime/eval/debugger/debugger.cpp +++ b/hphp/runtime/eval/debugger/debugger.cpp @@ -504,9 +504,11 @@ void Debugger::removeProxy(DebuggerProxyPtr proxy) { DebuggerProxyPtr Debugger::findProxy(const StringData* sandboxId) { TRACE(2, "Debugger::findProxy\n"); - ProxyMap::const_accessor acc; - if (m_proxyMap.find(acc, sandboxId)) { - return acc->second; + if (sandboxId) { + ProxyMap::const_accessor acc; + if (m_proxyMap.find(acc, sandboxId)) { + return acc->second; + } } return DebuggerProxyPtr(); }