Skip to content

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

@Ultroman

Description

@Ultroman

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions