From 4b9b1e5b3ae5ee72ddb39c1f9172b6333b6006a1 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 15 Mar 2016 20:32:52 -0400 Subject: [PATCH] Fix: config: check for content_size gt packet_size Signed-off-by: Philippe Proulx --- barectf/config.py | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.34.1