News:

Want to praise Simutrans?
Your feedback is important for us ;D.

Segmentation Fault for desc = NULL

Started by Yona-TYT, Today at 01:15:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Yona-TYT

There was a bug when trying to get a waytype = 6, because in pak64 this object does not exist, this is in reference to my other patch to get the last way/track used by the player: https://forum.simutrans.com/index.php/topic,23813.msg212102/topicseen.html#msg212102

0001-Fix-Segmentation-Fault-for-desc-NULL.patch

prissi

NUll should be a valid return paramter for non-existing ways.

Yona-TYT

Quote from: prissi on Today at 03:04:40 AMNUll should be a valid return paramter for non-existing ways.
Now I understand better, thank you.  8)

prissi

How did you end up seeing this? It should be impossible to build ways not defined in the pak since the init function of the waybuilder fails.

Yona-TYT

Quote from: prissi on Today at 12:46:27 PMHow did you end up seeing this? It should be impossible to build ways not defined in the pak since the init function of the waybuilder fails.
It was my mistake in the patch; I was sending a NULL descriptor when the package didn't contain the object.

I've tested your new implementation, and this error is now resolved here: https://github.com/simutrans/simutrans/commit/8b1f98d8dfa171825d10af8cd110e4020b0a5095