You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2022/11/10 22:02:19 UTC

[GitHub] [mina-sshd] tomaswolf commented on a diff in pull request #267: Validate ptyModes

tomaswolf commented on code in PR #267:
URL: https://github.com/apache/mina-sshd/pull/267#discussion_r1019652136


##########
sshd-common/src/main/java/org/apache/sshd/common/channel/PtyChannelConfiguration.java:
##########
@@ -94,6 +95,8 @@ public Map<PtyMode, Integer> getPtyModes() {
 
     @Override
     public void setPtyModes(Map<PtyMode, Integer> ptyModes) {
+        ptyModes.forEach(
+            (key, value) -> BufferUtils.validateUint32Value(value, "Mode %s has invalid value %s", key, value));

Review Comment:
   Make a copy of the map? The caller might add more values afterwards... And should getPtyModes() return a read-only copy?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org