Jump to content

Speaking of crashing for trivial things...


Murdoch

Recommended Posts

  • 1 month later...
Guest

I was using the original SMMU method when I got this crash. I'm now using the EMAPINFO lump and haven't tried to see if it crashes too.

Share this post


Link to post

It will. esselfortium has hit the same problem, only for him instead of crashing, it causes ExtraData to randomly malfunction by corrupting the lump name provided via MapInfo. I've identified the problem as the fix to the problem. That is, what I did to fix this bug in MapInfo is still wrong and will randomly fail to produce correct results. If your MapInfo lump is a multiple of 32 bytes in size, it will corrupt the next block on the zone heap and cause a crash.

The problem was two lines of code meant to normalize the lump and make parsing easier:

lump[size]     = '\n';
lump[size + 1] = '\0';
I forgot that I had already added +2 to size to account for the extra characters I add to the end of the file. This means that I'm writing two bytes past the end. The correct code should have been:
lump[size - 2] = '\n';
lump[size - 1] = '\0';
This'll be repaired in the next release. In the meanwhile, if you terminate your MapInfo lumps with a linebreak and avoid making them a multiple of 32 bytes in size, you shouldn't have any issues with this.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...