[
https://issues.apache.org/jira/browse/PROTON-2038?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kim van der Riet resolved PROTON-2038.
--------------------------------------
Resolution: Fixed
A simple check for negative values on initializing the class has been added.
Note that the __new__() method was used for Python 3 compatibility.
A test has also been added to the codec section which checks that initializing
an unsigned type with a negative value will result in an AssertionError.
> [Python] ubyte (and other unsigned types) can hold negative value
> -----------------------------------------------------------------
>
> Key: PROTON-2038
> URL: https://issues.apache.org/jira/browse/PROTON-2038
> Project: Qpid Proton
> Issue Type: Bug
> Components: python-binding
> Reporter: Kim van der Riet
> Assignee: Kim van der Riet
> Priority: Major
>
> Python representations of:
> proton.ubyte
> proton.ushort
> proton.uint
> proton.ulong
> can hold a negative value, even though they should be unsigned.
> {{import proton}}
> {{print proton.ubyte(-1)}}
> {{print proton.ushort(-1)}}
> {{print proton.uint(-1)}}
> {{print proton.ulong(-1)}}
> results in
> {{-1}}
> {{-1}}
> {{-1}}
> {{-1}}
> If an unsigned type containing a negative value is used in a message in any
> context, it can cause an Overflow exception to be thrown within Proton.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]