-
Notifications
You must be signed in to change notification settings - Fork 180
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
Large number of DIMSE sub-operations leads to integer overflow #982
Comments
Can you post the traceback please? I'm fairly certain as to the cause but would like to confirm. This is with you acting as the Move SCP, correct? |
Sorry about the format, this is the only way I could extract it. Yes, this occurred on a SCP server. |
The following elements all use a VR of US, which should be a 2-byte unsigned integer, range [0, 65535]:
The requirements for Query/Retrieve C-MOVE include this in Section C.1.4 (C-GET has similar requirements):
But then it also includes this requirement in Section C.4.2.3:
And in Section C.4.2.2:
However in Section C.4.2.1.7 we have:
In Section C.4.2.1.8:
In Section C.4.2.1.9:
All my emphasis. So if the number of matches is greater than 65535 then we can work around this by not sending Pending sub-operation status responses, but it's not completely clear if we must include the sub-operations summary in the final response, although I lean towards it being required given C.4.2.2 and C.4.2.3 are explicit descriptions for how a MOVE SCU and SCP are expected to behave. Cycling the sub-operations values is not a great idea as some SCUs may rely on them if they're present. One option is that since you're the SCP you can simply limit the number of allowed responses to less than 65535 (which I believe is what most QR SCPs do anyway to prevent resource mismanagement). |
At this point I'm mostly leaning towards simply disallowing more than 65535 responses with a suitable exception message and failure response status. |
Describe the bug
A large number of sub-operations can cause an integer overflow when the values are returned.
Example code block:
This happens also for
NumberOfFailedSuboperations
,NumberOfRemainingSuboperations
,NumberOfWarningSuboperations
Reference link
Expected behavior
Returning sub-operations should not cause integer overflow error.
Current workaround is using a fork with the following fix:
Steps To Reproduce
C-Move with a large Study
The text was updated successfully, but these errors were encountered: