From: Philippe Proulx Date: Wed, 16 Mar 2016 00:32:52 +0000 (-0400) Subject: Fix: config: check for content_size gt packet_size X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=4b9b1e5b3ae5ee72ddb39c1f9172b6333b6006a1;p=deliverable%2Fbarectf.git Fix: config: check for content_size gt packet_size Signed-off-by: Philippe Proulx --- diff --git a/barectf/config.py b/barectf/config.py index bc0e4cf..c088310 100644 --- a/barectf/config.py +++ b/barectf/config.py @@ -467,6 +467,10 @@ class _MetadataSpecialFieldsValidator: if content_size.signed: raise ConfigError('"content_size" field in stream packet context type must be an unsigned integer type') + # "packet_size" size should be greater than or equal to "content_size" size + if content_size.size > packet_size.size: + raise ConfigError('"content_size" field size must be lesser than or equal to "packet_size" field size') + def _validate_stream_event_header(self, stream): t = stream.event_header_type