From 8045711f3c4985b5fb85c5359a6cb516af09fe06 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 6 Mar 2013 20:42:35 +0100 Subject: dms: activation code string needs explicit 1-byte length prefix Reported by Arman Uguray --- build-aux/qmi-codegen/VariableString.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'build-aux') diff --git a/build-aux/qmi-codegen/VariableString.py b/build-aux/qmi-codegen/VariableString.py index a127eb7..faa2085 100644 --- a/build-aux/qmi-codegen/VariableString.py +++ b/build-aux/qmi-codegen/VariableString.py @@ -49,17 +49,17 @@ class VariableString(Variable): self.is_fixed_size = False # Variable-length strings in heap self.needs_dispose = True - # Strings which are given as the full value of a TLV will NOT have a - # length prefix - if 'type' in dictionary and dictionary['type'] == 'TLV': - self.length_prefix_size = 0 - elif 'size-prefix-format' in dictionary: + if 'size-prefix-format' in dictionary: if dictionary['size-prefix-format'] == 'guint8': self.length_prefix_size = 8 elif dictionary['size-prefix-format'] == 'guint16': self.length_prefix_size = 16 else: raise ValueError('Invalid size prefix format (%s): not guint8 or guint16' % dictionary['size-prefix-format']) + # Strings which are given as the full value of a TLV and which don't have + # a explicit 'size-prefix-format' will NOT have a length prefix + elif 'type' in dictionary and dictionary['type'] == 'TLV': + self.length_prefix_size = 0 else: # Default to UINT8 self.length_prefix_size = 8 -- cgit v1.1