irmen / Pyrolite

Java and .NET client interface for Pyro5 protocol
MIT License
178 stars 47 forks source link

Clear memo map after op code STOP #65

Closed viirya closed 5 years ago

viirya commented 5 years ago

Each unpickling should be independent. The memo map should not be reused without clearing between each loads/load call.

The added test shows the case that can cause wrong unpickled results. The serialized bytes were dumped from Python.

irmen commented 5 years ago

thanks for this! I'll fix the C# code myself.

viirya commented 5 years ago

Thanks!

irmen commented 5 years ago

note that Python's own Unpickler works a bit differently and does reuse the memo over sequential calls, but it reads pickles from a single stream passed at construction time.