Closed GoogleCodeExporter closed 9 years ago
Oh, and as to why this is relevant: I switched from XML serialization to
Protobuf recently (both in Base64 but that is not relevant to the problem
outlined above). All the settings in userspace still hold the Base64-converted
XML strings and I noticed that when I use these strings to deserialize using
Protobuf that there is no error but that the object returned is not
deserialized only constructed.
Original comment by mennod...@gmail.com
on 14 Feb 2013 at 8:54
For the record, I'm using NuGet package 2.0.0.621, not 2.0.0.628 (typo)
Original comment by mennod...@gmail.com
on 15 Feb 2013 at 7:11
Strictly speaking, the behavior is undefined when giving it invalid data; in
this case, it was breaking out because at the start of the data it detected
what looked like an "end group", which terminates an object.
In an *attempt* to better detect this, I am playing locally with 2 additional
checks:
- a check on unconsumed buffered data (note that there is still an edge case if
the fault is at the end of the buffer boundary)
- restrict the end-of-group special handling to cases where we expect it
both of these individually make your scenario fail (which is what we want). I'm
just working through some possible false-positives the regression suite, but I
think we can do a better job of detecting craziness.
But ultimately: "GIGO". We can *try* to detect obviously bad data - but some
types of bad data can accidentally satisfy any arbitrary tests we put in.
Original comment by marc.gravell
on 15 Feb 2013 at 8:52
Fixed in r628
Original comment by marc.gravell
on 15 Feb 2013 at 8:56
Original issue reported on code.google.com by
mennod...@gmail.com
on 14 Feb 2013 at 8:52