Comments (5)
the ByteBuffer passed to field.decode() looks like this:
ByteBuffer(offset=4,length=8,capacity=16)
-------------------------------------------------------------------
0A 02 08 01<0A 02 08 02>00 00 00 00 00 00 00 00 ................
from protobuf.js.
ok, seems to be the DEcoding that's hitting the problem. wrote the same values from C++ and checked with xxd:
#include <iostream>
#include <fstream>
#include <string>
#include "test.pb.h"
using namespace std;
int main() {
Outer outer;
Inner *inner;
inner = outer.add_inner();
inner->set_inner_value(1);
inner = outer.add_inner();
inner->set_inner_value(2);
fstream output("test.data", ios::out | ios::trunc | ios::binary);
if (!outer.SerializeToOstream(&output)) {
cerr << "Failed to write to test.data" << endl;
return 1;
}
return 0;
}
$ g++ test.cc test.pb.cc -lprotobuf
$ xxd test.data
0000000: 0a02 0801 0a02 0802 ........
from protobuf.js.
Fixed in 0.9.10: Decoder was broken for repeated fields as you said, also fixes encoding of zero length packed repeated fields (no tag, omitted).
from protobuf.js.
great, thanks again! you're response times are pretty fast!
from protobuf.js.
fyi: Packed repeated fields were still not working as intended, so 0.9.11 is up to fix this. It also includes tests for legacy, packed, both and neither legacy nor packed fields set in a single message - to be sure.
from protobuf.js.
Related Issues (20)
- [Feature Request] Explore all files in a folder/subfolder
- CVE-2022-25878 - Fix for version 5.0.3 HOT 3
- Decoding fails sometimes, logs attached HOT 1
- CVE-2023-36665 - Fix not reflected in dist version HOT 9
- index out of range
- Protobuf sources can't contain doxygen tags
- Parsing camelCase and snake_case JSON objects into protobuf.js messages HOT 1
- I found that @protobufjs/utf8 on npm or yarn is still the old code version. HOT 1
- "Invalid wire type n" "index out of range: n + 1 > n" HOT 5
- Is 6.11.4 an official release? HOT 2
- --target static-module --es6 --wrap es6 produces a code that fails to run HOT 3
- npm ERR! The "file" argument must be of type string
- When sending a payload I'm getting trailing NULLs
- not throw Error: illegal token ';' when loadSync with about 30+ proto files
- Bug in convert Root to object with solution
- camelCasing failing when key includes numbers HOT 1
- Cesium is not building due to protobufjs error HOT 2
- Project health? HOT 3
- Enumeration of OneOf field
- Reader.read_uint32 causes reader head misalignment when consuming oversized VARINTs in some cases
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protobuf.js.