Skip to content

Conversation

@i-am-fyre
Copy link
Contributor

@i-am-fyre i-am-fyre commented Jun 29, 2022

This change is Reviewable

@billy1arm
Copy link
Member

@i-am-fyre @Meltie2013 - I'd appreciate some eyes on this build !!

  • I have an issue yesterday where mmaps-generator crashed whenever I ran it, but due to a new PC / OS setup it could be my pc rather than the newer code.

@billy1arm
Copy link
Member

This is the partner PR to this commit: 1ba32d2

@billy1arm
Copy link
Member

Actually, it could be related to this:
https://app.codacy.com/gh/mangosthree/server/pullRequest?prid=9701603

uint32 pathLen = sWorld.GetDataPath().length() + strlen("mmaps/%04i.mmap") + 1;
char* fileName = new char[pathLen];
snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%03i.mmap").c_str(), mapId);
snprintf(fileName, pathLen, (sWorld.GetDataPath() + "mmaps/%04i.mmap").c_str(), mapId);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change causes Segmentation Fault because the format is out of bounds

int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS;

PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gy, gx);
PSendSysMessage("%04u%02i%02i.mmtile", player->GetMapId(), gy, gx);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this chage causes egmentation fault due to the format on this case is out of bounds

Copy link

@seobryn seobryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes that you propose are only aplicable for Map Generator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants