From f7e35d66b903263b7e31010114cafffd9b8e5055 Mon Sep 17 00:00:00 2001 From: Treeki Date: Tue, 23 Oct 2012 03:16:51 +0200 Subject: fixed a buffer overflow Clang revealed --- src/koopatlas/pathmanager.cpp | 6 +++--- 1 file 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; -- cgit v1.2.3