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

Unsigned int* used in CallbackSetProperty #42

Closed
Kaiserchen85 opened this issue Oct 11, 2023 · 1 comment
Closed

Unsigned int* used in CallbackSetProperty #42

Kaiserchen85 opened this issue Oct 11, 2023 · 1 comment

Comments

@Kaiserchen85
Copy link
Collaborator

Kaiserchen85 commented Oct 11, 2023

There is the use of unsigned int* in all of the CallbackSetProperty function's errorCode parameter.

The Problem:
Machines assume the size of an unsigned int. In other words, 64-bit machines will assume an integer to be 64 bits whereas 32-bit machines assume they are 32 bits. Thus, when a 64-bit machine tries to read an "unsigned int" from a 32-bit machine, it will read twice the amount of bits necessary, leading to unknown issues. A possible error could be seen below, where a pointer that is set to be allocated 16 bits of memory (unsigned int* declared by 16-bit machine) fails to convert into a pointer that is meant to have 32 bits of allocated memory:
image
We expect to avoid the error by standardizing the size of the unsigned integer.

BACnetServerExampleCPP version: 8eec294

@Kaiserchen85
Copy link
Collaborator Author

Fixed in 434b550

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