Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative CBORTag values are encoding without error in the C encoder #114

Closed
Sekenre opened this issue Jun 24, 2021 · 0 comments
Closed

Negative CBORTag values are encoding without error in the C encoder #114

Sekenre opened this issue Jun 24, 2021 · 0 comments
Assignees

Comments

@Sekenre
Copy link
Collaborator

Sekenre commented Jun 24, 2021

Example:

>>> # Pure python module
>>> from cbor2.encoder import dumps
>>> from cbor2.types import CBORTag
>>> dumps(CBORTag(-1, 'val'))
Traceback (most recent call last):
  ...
struct.error: ubyte format requires 0 <= number <= 255

>>> # c module
>>> import cbor2
>>> cbor2.dumps(cbor2.CBORTag(-1, 'val'))
b'\xdb\xff\xff\xff\xff\xff\xff\xff\xffcval'

CBORTag should raise a value error with a negative int

@Sekenre Sekenre self-assigned this Jun 24, 2021
Sekenre added a commit to Sekenre/cbor2 that referenced this issue Jun 24, 2021
@Sekenre Sekenre closed this as completed in 0a5ea98 Jul 2, 2021
vamega pushed a commit to vamega/cbor2 that referenced this issue Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant