mirror of https://github.com/davisking/dlib.git
Added more validation code to the BSP tools. Now they will do a little more
to detect invalid serialization.
This commit is contained in:
parent
23d1c1fa01
commit
cbbd84479a
|
@ -453,6 +453,10 @@ namespace dlib
|
|||
{
|
||||
std::istringstream sin(*temp);
|
||||
deserialize(item, sin);
|
||||
if (sin.peek() != EOF)
|
||||
throw serialization_error("deserialize() did not consume all bytes produced by serialize(). "
|
||||
"This probably means you are calling a receive method with a different type "
|
||||
"of object than the one which was sent.");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue