diff options
author | Treeki <treeki@gmail.com> | 2012-10-23 03:16:51 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-10-23 03:16:51 +0200 |
commit | f7e35d66b903263b7e31010114cafffd9b8e5055 (patch) | |
tree | a4317ff51fd40609e01b749cfeb655111f2e242a /src | |
parent | 9fa22baae0d44278cd73a54c1c4a11eac9255bff (diff) | |
download | kamek-f7e35d66b903263b7e31010114cafffd9b8e5055.tar.gz kamek-f7e35d66b903263b7e31010114cafffd9b8e5055.zip |
fixed a buffer overflow Clang revealed
Diffstat (limited to 'src')
-rw-r--r-- | src/koopatlas/pathmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/koopatlas/pathmanager.cpp b/src/koopatlas/pathmanager.cpp index 032d40b..abcfd76 100644 --- a/src/koopatlas/pathmanager.cpp +++ b/src/koopatlas/pathmanager.cpp @@ -657,12 +657,12 @@ void dWMPathManager_c::moveThroughPath() { OSReport("Activating world change %d\n", to->worldID); const dKPWorldDef_s *world = dScKoopatlas_c::instance->mapData.findWorldDef(to->worldID); if (world) { - if (strncmp(save->newerWorldName, world->name, 36) == 0) { + if (strncmp(save->newerWorldName, world->name, 32) == 0) { OSReport("Already here\n"); } else { OSReport("Found!\n"); - strncpy(save->newerWorldName, world->name, 36); - save->newerWorldName[35] = 0; + strncpy(save->newerWorldName, world->name, 32); + save->newerWorldName[31] = 0; save->newerWorldID = world->worldID; save->currentMapMusic = world->trackID; |