-
Notifications
You must be signed in to change notification settings - Fork 129
PVA: harden handling of protocol sizes #3878
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
base: master
Are you sure you want to change the base?
Changes from all commits
98dae2b
d13aae4
7d87fc4
53d4f22
c0a9c67
f431319
9ec22e0
b702fda
7002a4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -97,6 +97,9 @@ | |
| result.found = PVABool.decodeBoolean(buffer); | ||
|
|
||
| final int count = Short.toUnsignedInt(buffer.getShort()); | ||
| if (count*Integer.BYTES > buffer.remaining()) | ||
| throw new Exception("PVA Server sent search reply #" + result.seq + " for " + count + " CIDs " + | ||
|
Check warning on line 101 in core/pva/src/main/java/org/epics/pva/common/SearchResponse.java
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have a unit test that checks this exception is raised. |
||
| " with only " + buffer.remaining() + " bytes in buffer"); | ||
| result.cid = new int[count]; | ||
| for (int i=0; i<count; ++i) | ||
| result.cid[i] = buffer.getInt(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than this I think the template for a format string makes sense? i.e.
private static final String LOG_SENT_SEARCH_FORMAT = "PVA Client %s sent search #%s" ?