-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check well-formedness of CDR before extracting key
The python serializer doesn't detect that in: enum E { A, B, C } union T switch(E) { ... } union U switch(boolean) { case true: T value } struct S { U m } write (S(m=T(discriminant=B, value=...))) there's an entire union missing in the value to be written, and because it can't find "B" in the list of labels in U (i.e., "B" is not in "[True]") it serializes "B" and skips "value". It so happens that "B"'s serialization matches that of "True" (on a little endian machine, but there are variants where endianness doesn't matter), and so "dds_stream_extract_key" will take the "true" case and try to deserialize T. It doesn't handle malformed input, so bad things happen. I don't know how to prevent this type confusion in the Python serializer, but I do know how to check for malformed input. Signed-off-by: Erik Boasson <[email protected]>
- Loading branch information
Showing
1 changed file
with
88 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters