SaveGlobal function does not save "/" character correctly

Bug #1426857 reported by Andre Novellino Gouvêa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Stratagus
Fix Released
Low
cybermind

Bug Description

The "std::string SaveGlobal(lua_State *l, bool is_root, std::vector<std::string> &blockTableNames)" function, in script.cpp, does not save the "/" character correctly in strings, potentially causing crashes when a game is loaded. For example, if we have the following string:

"The name \"Marcomanni\" means \"march-men\", or \"frontier-men\"."

...it will be saved as:

"The name "Marcomanni" means "march-men", or "frontier-men"."

...which will cause a crash upon game load.

Related branches

Revision history for this message
cybermind (iddqd-mail) wrote :

Try to use "\\" combination to save "\" symbol

Changed in stratagus:
status: New → Incomplete
assignee: nobody → cybermind (iddqd-mail)
importance: Undecided → Low
Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

Wouldn't that just mean that the crash would happen after loading two games, instead of one?

When loading the first game, "\\" would be converted to "\". And then, if the player saves the game again, this new save will become corrupt (because the "\" will disappear), and cause a crash upon loading.

Revision history for this message
cybermind (iddqd-mail) wrote :

Fixed in rev.8963

Changed in stratagus:
status: Incomplete → Fix Committed
Revision history for this message
Andre Novellino Gouvêa (andre-ng) wrote :

thanks :)

cybermind (iddqd-mail)
Changed in stratagus:
status: Fix Committed → Fix Released
milestone: none → 2.3
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.