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

asn1: fix for byte buffer to uint64_t helper #1008

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexandre-huff
Copy link

Hi,

This is a proposal of a fix in the function that converts a byte_buffer to a uint64_t value.

Currently, when the size of a byte_buffer is greater than 1, the code mistakenly converts the bytes into the uint64_t value.

The static_cast<uint64_t>((nbytes - 1 - i) * 8U) erroneously inverts the order of the bits in the resulting value, so that functions void octet_string_helper::to_octet_string(srsran::byte_buffer& buf, uint64_t number) and uint64_t octet_string_helper::to_uint(const byte_buffer& buf) are not equivalent.

@ismagom ismagom requested a review from frankist January 10, 2025 08:10
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.

1 participant