in simplest case std::string is serialized this way:
length|string data.
in this case it's possible to feed invalid data to deserialization
function so that application stalls waiting for the os to reserve huge
pile or ram, or fails with bad alloc.
this invalid data could be intentionally manually edited or as well it
could be the case where you serialize ints and then try to deserialize
data as strings (or whatever else).
isn't it possible to have archives such check somehow the size of
available stream data. (eg, for stringstream), or archives that
initialized with a data pointer and the size of the data pointed by that
pointer or maybe something else
here's a complete example that shows such problem in action
/////////////////////////////
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include