You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2014/11/14 12:03:24 UTC

[15/50] [abbrv] qpid-proton git commit: PROTON-714: don't overflow the input buffer

PROTON-714: don't overflow the input buffer

git-svn-id: https://svn.apache.org/repos/asf/qpid/proton/trunk@1632004 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/e843420a
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/e843420a
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/e843420a

Branch: refs/heads/examples
Commit: e843420acf266a836b965683129cd8693df3d796
Parents: 7c9abd0
Author: Rafael H. Schloming <rh...@apache.org>
Authored: Wed Oct 15 12:45:47 2014 +0000
Committer: Rafael H. Schloming <rh...@apache.org>
Committed: Wed Oct 15 12:45:47 2014 +0000

----------------------------------------------------------------------
 .../qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e843420a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java
index 2599290..a25ea46 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/engine/impl/ssl/SimpleSslTransportWrapper.java
@@ -125,7 +125,13 @@ public class SimpleSslTransportWrapper implements SslTransportWrapper
             } else {
                 ByteBuffer tail = _underlyingInput.tail();
                 _decodedInputBuffer.flip();
+                int limit = _decodedInputBuffer.limit();
+                int overflow = _decodedInputBuffer.remaining() - capacity;
+                if (overflow > 0) {
+                    _decodedInputBuffer.limit(limit - overflow);
+                }
                 tail.put(_decodedInputBuffer);
+                _decodedInputBuffer.limit(limit);
                 _decodedInputBuffer.compact();
                 _underlyingInput.process();
                 capacity = _underlyingInput.capacity();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org