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

diagnose crashes when cose sign1 payload is null #187

Closed
OR13 opened this issue Jan 30, 2024 · 2 comments
Closed

diagnose crashes when cose sign1 payload is null #187

OR13 opened this issue Jan 30, 2024 · 2 comments

Comments

@OR13
Copy link

OR13 commented Jan 30, 2024

const cbor = require('cbor-web');
(async () => {
  console.log(await cbor.diagnose(Buffer.from('d28443a10126a0f75840430c3d8593664fcc91be9e636d188161224da282b47aec290590c208ec0f350098e658614270271c04b2292e13342eaa3f8449176b0da59ecfb941f84a616282', 'hex')))
  console.log(await cbor.diagnose(Buffer.from('d28443a10126a0f65840e60e1afde353695c0aa6375e59f9f00cf48fdafe80bfd684d0b4fd001ed47078ead504c8d024baa85e4a659514868f7f74928fd5046bc78e9e8fdb202893ac4c', 'hex')))
})()

Expect payload to be primitive(22) for null and primitive(23) for undefined.

Both decode successfully on cbor.me

@hildjj
Copy link
Owner

hildjj commented Jan 30, 2024

Reproduced with the input '81f6'

@hildjj hildjj closed this as completed in c71b7b5 Jan 30, 2024
hildjj added a commit that referenced this issue Jan 30, 2024
@hildjj
Copy link
Owner

hildjj commented Jan 31, 2024

Fixed in 9.0.2

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

2 participants