diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 14:32:30 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-09-06 14:32:30 +0000 |
commit | 027f1c9655391dcb2b0117f931f720211ac933db (patch) | |
tree | 94980f450aa3daec3e1fec217374704ad62cfe45 /source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 5e95aa85bb660d45e9905ef1d7180b2678280660 (diff) |
Vendor import of (stripped) lldb trunk r242221:vendor/lldb/lldb-trunk-r242221
Diffstat (limited to 'source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 1af3947a75f3..9c263c8c4087 100644 --- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -564,8 +564,12 @@ GDBRemoteCommunication::DecompressPacket () return true; size_t pkt_size = m_bytes.size(); - if (pkt_size < 6) + + // Smallest possible compressed packet is $N#00 - an uncompressed empty reply, most commonly indicating + // an unsupported packet. Anything less than 5 characters, it's definitely not a compressed packet. + if (pkt_size < 5) return true; + if (m_bytes[0] != '$' && m_bytes[0] != '%') return true; if (m_bytes[1] != 'C' && m_bytes[1] != 'N') |