Skip to content

Fixed bug in package_tool#3

Open
anomie0xff wants to merge 1 commit intomitre-cyber-academy:mainfrom
anomie0xff:main
Open

Fixed bug in package_tool#3
anomie0xff wants to merge 1 commit intomitre-cyber-academy:mainfrom
anomie0xff:main

Conversation

@anomie0xff
Copy link
Copy Markdown

@anomie0xff anomie0xff commented Feb 8, 2023

package_tool takes a feature_number and tries to convert it to 1 byte with feature_number.to_bytes(1, "little") which will break for any feature numbers greater than 255 with the error OverflowError: int too big to convert. The technical specification says the feature number is 32 bits long.

To make it conform to the technical specifications but with minimal refactoring (the package number is expected to be 1 byte in several places), and since the only feature numbers that will be used are 1 and 2, the feature number is truncated to 8 bits during packaging

@krscaplen
Copy link
Copy Markdown

@dtwalter approved

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

Successfully merging this pull request may close these issues.

2 participants