[Lldb-commits] [PATCH] D49307: Fix some crashes and deadlocks in FormatAnsiTerminalCodes

Raphael Isemann via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jul 13 10:28:42 PDT 2018


teemperor created this revision.
teemperor added a reviewer: davide.
Herald added a subscriber: mgorny.

This patch fixes a few problems with the FormatAnsiTerminalCodes function:

- It does an infinite loop on an unknown color value.
- It crashes when the color value is at the end of the string.
- It deletes the first character behind the color token.

Also added a few tests that reproduce those problems (and test some other corner cases).


https://reviews.llvm.org/D49307

Files:
  include/lldb/Utility/AnsiTerminal.h
  unittests/Utility/AnsiTerminalTest.cpp
  unittests/Utility/CMakeLists.txt

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49307.155423.patch
Type: text/x-patch
Size: 3181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20180713/09e20a84/attachment.bin>


More information about the lldb-commits mailing list