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

unsigned integer overflow #499

Closed
steed717 opened this issue Mar 15, 2022 · 4 comments
Closed

unsigned integer overflow #499

steed717 opened this issue Mar 15, 2022 · 4 comments
Milestone

Comments

@steed717
Copy link

Bug: len - pref_len will cause integer overlow.
Sugested fix below:

diff --git a/protobuf-c/protobuf-c.c b/protobuf-c/protobuf-c.c
index ad1bdb1..fe5ae91 100644
--- a/protobuf-c/protobuf-c.c
+++ b/protobuf-c/protobuf-c.c
@@ -2604,10 +2604,13 @@ parse_required_member(ScannedMember *scanned_member,
return FALSE;

            def_mess = scanned_member->field->default_value;
  •           subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
    
  •           if (len > pref_len)
    
  •                   subm = protobuf_c_message_unpack(scanned_member->field->descriptor,
                                               allocator,
                                               len - pref_len,
                                               data + pref_len);
    
  •           else
    
  •                   subm = NULL;
    
              if (maybe_clear &&
                  *pmessage != NULL &&
    
steed717 pushed a commit to steed717/protobuf-c that referenced this issue Mar 18, 2022
Signed-off-by: 10054172 <hui.zhang@thalesgroup.com>
@steed717
Copy link
Author

steed717 commented Apr 8, 2022

can any review to be done with this issue ???

@steed717
Copy link
Author

is this project still active???

@ghenry
Copy link

ghenry commented Apr 19, 2022

The forum looks non-responsive - https://groups.google.com/g/protobuf-c

I'm not sure who the project leads are or if they are looking for help?

@eslerm
Copy link

eslerm commented Jul 7, 2022

I'm not sure who the project leads are or if they are looking for help?

@edmonds publishes new releases

edmonds pushed a commit that referenced this issue Jul 11, 2022
Signed-off-by: 10054172 <hui.zhang@thalesgroup.com>
@edmonds edmonds added this to the 1.4.1 milestone Jul 11, 2022
edmonds added a commit that referenced this issue Jul 11, 2022
Fix issue #499: unsigned integer overflow
@edmonds edmonds closed this as completed Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants