This is an automated email from the ASF dual-hosted git repository.

liujun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-hessian-lite.git


The following commit(s) were added to refs/heads/master by this push:
     new 40c9d06  reset _offset to 0 after 'N' check
40c9d06 is described below

commit 40c9d06fd01068f820bcb75d4f7a0448ce1704b8
Author: ken.lj <[email protected]>
AuthorDate: Thu Mar 19 12:18:31 2020 +0800

    reset _offset to 0 after 'N' check
---
 src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java 
b/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java
index f241d63..09a290b 100644
--- a/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java
+++ b/src/main/java/com/alibaba/com/caucho/hessian/io/Hessian2Input.java
@@ -187,11 +187,12 @@ public class Hessian2Input
     @Override
     public boolean checkAndReadNull() {
         try {
+            int _tmp_offset = _offset;
             int tag = read();
             if ('N' == tag) {
                 return true;
             }
-            _offset--;
+            _offset = _tmp_offset;
         } catch (IOException ignored) {
         }
         return false;

Reply via email to