Merge pull request #703 from smuellerDD/fix_corruption

protobuf_c_message_unpack(): Fix memory corruption by initializing unknown_fields pointer
This commit is contained in:
Robert Edmonds 2024-03-21 03:30:39 +00:00 committed by GitHub
commit 5c13d7dfe9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3278,6 +3278,8 @@ protobuf_c_message_unpack(const ProtobufCMessageDescriptor *desc,
n_unknown * sizeof(ProtobufCMessageUnknownField));
if (rv->unknown_fields == NULL)
goto error_cleanup;
} else {
rv->unknown_fields = NULL;
}
/* do real parsing */