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

FullSerializer often stalls when you try to load an encoded file without using the encoder. #31

Open
Ultroman opened this issue Mar 24, 2023 · 0 comments

Comments

@Ultroman
Copy link

Ultroman commented Mar 24, 2023

Describe the bug
The SaveGameSimpleEncoder happily loads unencrypted files, instead of rejecting them. Because of that, I wanted to do a check to see that the file IS indeed encoded, so as to not allow files that are not encoded. To do so, I try to call SaveGame.Load() with the 'encode' parameter set to false, hoping to just be able to check that the result is null, and if it isn't I reject it, but if it is, then I proceed to try to load it with 'encode' set to true. Instead, FullSerializer stalls on the .Deserialize() call.

To Reproduce
Steps to reproduce the behavior:

  1. Make a file with the following byte-string in it: /n9F8q9UVOGEwCzFVEVRZvqHPBgHTGS25SPXqTXRlw+x7x5hfKznRSArbWeirwyxwoCXTAWgquAnSa89rGg5Cm158vpxCsIQRUx2ahPsFimFOpyNcNJGPsJjc53x/rojfhMq36AwO6wycEiQyJtoeBAnA1DiiEqZAJ5w+idQUVl4Zn1Grg7JTk9KPu5Pr8CijyaSmDX6dRhlUcGvQUQ86E+kYOn5LeerCdHTtXhugHAPAsiuaBfY3TamRWjPDVul3ST+ezAXb5/6HVxLmmgUBj2nj42uDcjSVkLkNoL4/zD4yEymu1OtZ+8rkwtqjOfrAeuBmElTZawrmWJdpzaFZsG642ZCm2KFkt6lPDun10CG8iveaBIWO567C5S0F6SeyoMkKUhHLqkrhHCGMHDz6DnfTRYAF72nBMLhtH0G1k18FNajvuVWMzqEIbgT/QaB6iXbLWLB4rzIpVJUZNS+B4MA9ZnXnl/VinlUWogck+Is5W1v4bmQb6Ltw/PJqK8mrIgRi9rFMOejO3OJ5phdqy37ARjHt+gygpjNZbcOXyQ=
  2. Do this call: SaveGame.Load<Dictionary<string, object>>(filePathAndName, false, string.Empty);

Expected behavior
For it to throw an exception or fail, and/or for SaveGame.Load() to return null if it does.

Desktop (please complete the following information):

  • OS: Windows 10
  • Unity 2021.3.16f1
  • Save Game Free - Gold Update v2.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant