-
Notifications
You must be signed in to change notification settings - Fork 153
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
Input buffer size value gets truncated when it exceeds the size limit #263
Comments
The value (greater than int32) passed down to Suggest validating the value if it is within range in input_buf_size.setter and output_buf_size.setter. Raise error if value is out of range. |
@WayneDroid This issue is not unique to the buffer size attributes. If ctypes doesn't perform a range check when we convert an Protobuf does perform a range check when assigning integer fields, so Here is the test output if I update it to demonstrate this issue:
|
@WayneDroid Two more things: We should figure out whether this issue is specific to the attribute setter functions. The Also, the Pydantic module may be able to do this sort of range validation based on type hints. However, I haven't used it before and I'm aware that it recently went through a large compatibility break. |
If the input buffer size is assigned a value greater than the size of int32, then the value is truncated and assigned to the buffer size.
I tried to assign a value of
800000000000
to the buffer size and the expectation was that it would raise an error. Rather the buffer was assigned with a value of1136082944
.NI IO Trace shows that the input_buf_size is getting truncated from 800000000000 to 1136082944 before calling the DAQmx C API,
The text was updated successfully, but these errors were encountered: