protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

[C++] Segmentation fault when call ParseFromString with bad data

Open wcb33 opened this issue 1 year ago • 1 comments

What version of protobuf and what language are you using? Version: v3.12, install by apt in Debian 12 Language: C++

What operating system (Linux, Windows, ...) and version? Debian 12

What runtime / compiler are you using (e.g., python version or gcc version) clang

What did you do? Run this code

int main(int argc, char** args)
{
    string v1("1");
    TestPackage p;
    //if (p.ParsePartialFromString(v1))
    if (p.ParseFromString(v1))
    {
        cout << "succeed" << endl;
    }
    else
    {
        cout << "error" << endl;
    }
    cout << "quit" << endl;
}

What did you expect to see print "error"

What did you see instead? Segmentation fault image

Anything else we should know about your project / environment The proto

syntax = "proto3";

option cc_enable_arenas = false;

package Base;
message TestPackage
{
    int32 Function = 1;
    fixed64 ID = 2;
}

wcb33 avatar Jun 26 '24 07:06 wcb33

Do you still hit this in a recent, supported version of protobuf e.g. 4.25.x, 5.27.x? Protobuf v3.12 is very old and out of support. https://protobuf.dev/support/version-support/#cpp

zhangskz avatar Jul 01 '24 20:07 zhangskz

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.

github-actions[bot] avatar Dec 13 '24 10:12 github-actions[bot]

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

github-actions[bot] avatar Dec 28 '24 10:12 github-actions[bot]