[haiku-commits] haiku: hrev51435 - src/apps/terminal

  • From: pulkomandy@xxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 23 Sep 2017 16:46:39 +0200 (CEST)

hrev51435 adds 1 changeset to branch 'master'
old head: 1a472d01fd4786e7571604b56c4da926733cb735
new head: 7cb920e579e2a97403c3c6d6c157d3020fc5c7d1
overview: 
http://cgit.haiku-os.org/haiku/log/?qt=range&q=7cb920e579e2+%5E1a472d01fd47

----------------------------------------------------------------------------

7cb920e579e2: Fix crash in 256-color setup parsing
  
  Applications can control the 256-color mode and change the palette. This
  was not much used until now, but our terminal is now advertising itself
  as xterm-256color. Mutt noticed this, tried to use the escape sequence,
  and crashed Terminal here.

                             [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev51435
Commit:      7cb920e579e2a97403c3c6d6c157d3020fc5c7d1
URL:         http://cgit.haiku-os.org/haiku/commit/?id=7cb920e579e2
Author:      Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date:        Sat Sep 23 14:42:27 2017 UTC

----------------------------------------------------------------------------

1 file changed, 2 insertions(+), 2 deletions(-)
src/apps/terminal/TermParse.cpp | 4 ++--

----------------------------------------------------------------------------

diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp
index aaeb336..b80d3d9 100644
--- a/src/apps/terminal/TermParse.cpp
+++ b/src/apps/terminal/TermParse.cpp
@@ -1518,7 +1518,7 @@ TermParse::_ProcessOperatingSystemControls(uchar* params)
                                // colors can be in 
"idx1:name1;...;idxN:nameN;" sequence too!
                                uint32 count = 0;
                                char* p = strtok((char*)params, ";");
-                               do {
+                               while (p != NULL && count < kTermColorCount) {
                                        indexes[count] = atoi(p);
 
                                        if (!reset) {
@@ -1532,7 +1532,7 @@ TermParse::_ProcessOperatingSystemControls(uchar* params)
                                                count++;
 
                                        p = strtok(NULL, ";");
-                               } while (p != NULL && count < kTermColorCount);
+                               };
 
                                if (count > 0) {
                                        if (!reset)


Other related posts:

  • » [haiku-commits] haiku: hrev51435 - src/apps/terminal - pulkomandy