Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaveGlobal function does not save "/" character correctly #26

Closed
timfel opened this issue Nov 19, 2015 · 4 comments
Closed

SaveGlobal function does not save "/" character correctly #26

timfel opened this issue Nov 19, 2015 · 4 comments

Comments

@timfel
Copy link
Member

timfel commented Nov 19, 2015

The "std::string SaveGlobal(lua_State *l, bool is_root, std::vectorstd::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.


Imported from Launchpad using lp2gh.

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by iddqd-mail)
Try to use "" combination to save "" symbol

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by andre-ng)
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.

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by iddqd-mail)
Fixed in rev.8963

@timfel
Copy link
Member Author

timfel commented Nov 19, 2015

(by andre-ng)
thanks :)

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

No branches or pull requests

1 participant