Fix: config: check for content_size gt packet_size
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 16 Mar 2016 00:32:52 +0000 (20:32 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Mar 2016 21:54:59 +0000 (17:54 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
barectf/config.py

index bc0e4cfc81ec237100fc66dd3136efb38b4e30bb..c0883109543f5eb90f5d34f86492267183bc7957 100644 (file)
@@ -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
 
This page took 0.03663 seconds and 4 git commands to generate.