summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorDennis Friis <peavey@placid.dk>2008-04-16 11:50:12 +0000
committerDennis Friis <peavey@placid.dk>2008-04-16 11:50:12 +0000
commit4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609 (patch)
tree2639c9414e48adf59348b0007bd165ce9b0f17cb /src/gui
parentf2753bb01b8c1e1c5b487dcf08032e4e4f16c9a1 (diff)
downloadmana-client-4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609.tar.gz
mana-client-4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609.tar.bz2
mana-client-4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609.tar.xz
mana-client-4e0253cfd7c6a7684341f55f4a1f3dd88eeb5609.zip
Also fix potential out of range in BrowserBox::draw when checking for color codes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/browserbox.cpp3
1 files changed, 2 insertions, 1 deletions
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) == '#'))