From 4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609 Mon Sep 17 00:00:00 2001 From: Dennis Friis Date: Wed, 16 Apr 2008 11:50:12 +0000 Subject: Also fix potential out of range in BrowserBox::draw when checking for color codes. --- src/gui/browserbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui/browserbox.cpp') diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp index a2613389..f6c9c51c 100644 --- a/src/gui/browserbox.cpp +++ b/src/gui/browserbox.cpp @@ -314,7 +314,8 @@ BrowserBox::draw(gcn::Graphics *graphics) for (j = 0; j < row.size(); j++) { - if (mUseLinksAndUserColors || (!mUseLinksAndUserColors && (j == 0))) + if ( (mUseLinksAndUserColors && (j + 3) <= row.size()) || + (!mUseLinksAndUserColors && (j == 0)) ) { // Check for color change in format "##x", x = [L,P,0..9] if ((row.at(j) == '#') && (row.at(j + 1) == '#')) -- cgit v1.2.3-70-g09d2