Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: Add check for existing array before reading #2042

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

Open
marsv024 wants to merge 1 commit into protobufjs:master
base: master
Choose a base branch
Loading
from marsv024:fix-undefined-read-when-reading-oneoffs

Conversation

Copy link

@marsv024 marsv024 commented Jan 24, 2025

When parsing a proto and handling oneofs there is no check if the array actually exists before reading it, causing the code to throw errors some times.

This change add a check if the oneoffsArray exist before trying to read it.

Seems to be the samme issue as described in: #1958

nzrvg, josephharrington, and abobr reacted with thumbs up emoji
When parsing a proto and handling oneofs there is no check if the
array actually exists before reading it, causing the code to throw
errors some times.
This change add a check if the oneoffsArray exist before trying to
read it.
Copy link
Contributor

@sofisl Is this something you could help get merged and released? I found this open PR after we started running into this error as well, but I'm not sure who exactly to ping.

It seems to be much more likely to hit the indexOf error when using @grpc/proto-loader since that library uses the toDescriptor methods.

I added a minimal repro of the issue to #1958. I'm happy to add a regression test as well if it will help this get merged and released. Thanks!

Copy link
Contributor

@dcodeIO Is this something you could help get merged and released? Or who would be the best maintainer to take a look? Thanks!

Copy link

abobr commented Jul 8, 2025

would be nice to have this merged. we use an npm hook in order to manually fix package after installation

josephharrington reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /