Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null values for "map" type causes Buffer overrun on some languages #21

Open
mhoeger opened this issue Nov 28, 2018 · 1 comment
Open
Assignees
Labels
2.0 breaking bug Something isn't working
Milestone

Comments

@mhoeger
Copy link
Contributor

mhoeger commented Nov 28, 2018

Causes buffer overrun, first reported here: Azure/azure-functions-nodejs-worker#142

The root cause of this issue is that we use a "map" in our protobuf file.

From the protocol buffers docs:

If you provide a key but no value for a map field, the behavior when the field is serialized is language-dependent. In C++, Java, and Python the default value for the type is serialized, while in other languages nothing is serialized.

In combination with protobuf.js, this results in generated code that overflows.

                    case 15:
                        reader.skip().pos++;
                        if (message.query === $util.emptyObject)
                            message.query = {};
                        key = reader.string();
                        reader.pos++;
                        message.query[key] = reader.string();
                        break;
@bterlson
Copy link
Member

bterlson commented Apr 6, 2020

Got bit by this today. Any ETA? Anything I can help with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 breaking bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants