diff options
author | Jason Molenda <jmolenda@apple.com> | 2017-08-18 22:57:59 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2017-08-18 22:57:59 +0000 |
commit | fba547d7e7f262df067f035326677e27c9a23175 (patch) | |
tree | 52304da0abdf27e1a37d90203da607d3d0f2eddc /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 88ffa3afe289b02889957070ba6ac132fd4f2ce4 (diff) | |
download | bcm5719-llvm-fba547d7e7f262df067f035326677e27c9a23175.tar.gz bcm5719-llvm-fba547d7e7f262df067f035326677e27c9a23175.zip |
Commiting Christopher Brook's patch for
"Prevent negative chars from being sign-extended into isprint and isspace which take and int and crash if the int is negative"
https://reviews.llvm.org/D36620
llvm-svn: 311207
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 0c4df7e3f30..ac475fa10d3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -815,7 +815,8 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len, // checksum if (m_bytes[0] == '$' && total_length > 4) { for (size_t i = 0; !binary && i < total_length; ++i) { - if (isprint(m_bytes[i]) == 0 && isspace(m_bytes[i]) == 0) { + unsigned char c = m_bytes[i]; + if (isprint(c) == 0 && isspace(c) == 0) { binary = true; } } |