Skip to content
Permalink
Browse files

HDB: Fix out of bounds read in HDBGame::setInMapName

  • Loading branch information...
bgK committed Sep 8, 2019
1 parent 042e196 commit 997e15878ad72e773ca3835b756daf02d0f7334d
Showing with 2 additions and 5 deletions.
  1. +2 −5 engines/hdb/hdb.cpp
@@ -849,7 +849,7 @@ void HDBGame::drawLoadingScreen() {

struct MapName {
const char *fName, *printName;
} mapNames[] = {
} static mapNames[] = {
{ "MAP00", "HDS Colby Jack" },
{ "MAP01", "Servandrones, Inc." },
{ "MAP02", "Pushbot Storage" },
@@ -884,15 +884,12 @@ struct MapName {
};

void HDBGame::setInMapName(const char *name) {
int i = 0;

while (mapNames[i].fName) {
for (uint i = 0; i < ARRAYSIZE(mapNames); i++) {
if (!scumm_stricmp(name, mapNames[i].fName)) {
memset(&_inMapName, 0, 32);
strcpy(_inMapName, mapNames[i].printName);
return;
}
i++;
}

memset(&_inMapName, 0, 32);

0 comments on commit 997e158

Please sign in to comment.
You can’t perform that action at this time.