Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4574283f authored by Gregory Montoir's avatar Gregory Montoir
Browse files

Restrict fields stripping to TYPE_MESSAGE

Section 1002 (/proc/version) is primitive data (TYPE_STRING)

Bug: 277334359
Bug: 328677623
Test: adb shell incident -p AUTOMATIC 1002 | protoc --decode_raw
Change-Id: I2f9728d542becd3690522b3a113a4760c7d324d2
parent a2c40221
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -195,7 +195,9 @@ status_t FieldStripper::strip(const uint8_t privacyPolicy) {
        ProtoOutputStream proto(mEncodedBuffer);

        // Optimization when no strip happens.
        if (mRestrictions == NULL || spec.RequireAll()) {
        if (mRestrictions == NULL || spec.RequireAll()
                // Do not iterate through fields if primitive data
                || !mRestrictions->children /* != FieldDescriptor::TYPE_MESSAGE */) {
            if (spec.CheckPremission(mRestrictions)) {
                mSize = mData->size();
            }