aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilun Chong <yilunchong@google.com>2018-08-01 15:39:03 -0700
committerYilun Chong <yilunchong@google.com>2018-08-01 15:39:03 -0700
commit600e4e5f3b2d1a852a07de61d69e7245b78a5bf3 (patch)
treebe15533fe8270f16bdcd1cb05d04c4ecd5e0731b
parent1bec76f04cbaee8c48fecb2c21ff1015f398caf5 (diff)
downloadprotobuf-600e4e5f3b2d1a852a07de61d69e7245b78a5bf3.tar.gz
protobuf-600e4e5f3b2d1a852a07de61d69e7245b78a5bf3.tar.bz2
protobuf-600e4e5f3b2d1a852a07de61d69e7245b78a5bf3.zip
fix
-rw-r--r--js/binary/reader_test.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/binary/reader_test.js b/js/binary/reader_test.js
index e1e6efa1..69739727 100644
--- a/js/binary/reader_test.js
+++ b/js/binary/reader_test.js
@@ -682,10 +682,15 @@ describe('binaryReaderTest', function() {
// Previously the skipGroup implementation was wrong, which only consume
// the decoder by nextField. This case is for making the previous
// implementation failed in skipGroup by an early end group tag.
+ // The reason is 44 = 5 * 8 + 4, this will be translated in to a field
+ // with number 5 and with type 4 (end group)
writer.writeInt64(44, 44);
+ // This will make previous implementation failed by invalid tag (7).
+ writer.writeInt64(42, 47);
writer.writeInt64(42, 42);
// This is for making the previous implementation failed by an invalid
- // varint.
+ // varint. The bytes have at least 9 consecutive minus byte, which will
+ // fail in this.nextField for previous implementation.
writer.writeBytes(43, [255, 255, 255, 255, 255, 255, 255, 255, 255, 255]);
writer.writeGroup(6, dummyMessage, function() {
writer.writeInt64(84, 42);