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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user