diff options
Diffstat (limited to 'python/qpid')
| -rw-r--r-- | python/qpid/codec.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/qpid/codec.py b/python/qpid/codec.py index a0d9696c8b..a11486376d 100644 --- a/python/qpid/codec.py +++ b/python/qpid/codec.py @@ -178,8 +178,10 @@ class Codec: encodes long (32 bits) data 'o' in network byte order """ - if (o < 0): - raise ValueError('unsinged long int cannot be less than 0') + # we need to check both bounds because on 64 bit platforms + # struct.pack won't raise an error if o is too large + if (o < 0 or o > 4294967295): + raise ValueError('Valid range of long int is [0,4294967295]') self.pack("!L", o) |
