cve-bin-tool
cve-bin-tool copied to clipboard
fix: TypeError in fuzz_python_requirement_parser in fuzzing reports
Related #4045
Related to fuzzing run https://github.com/intel/cve-bin-tool/actions/runs/8595897802.
This TypeError seems kinda strange because google.protobuf.json_format.MessageToDict
does contain the argument including_default_value_fields
Source: https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html
@terriko I want to work on this issue. Can you assign me please?
@ranjanmangla1 have fun! You don't need to ask to be assigned to issues, BTW, just saying that you're working on them in a comment is sufficient.
@terriko The problem is protobuf being >= 5.26. The said argument has been replaced.
Definition
There's no including_default_value_fields
argument.
def MessageToDict( message: Message, always_print_fields_with_no_presence: bool = False, preserving_proto_field_name: bool = False, use_integers_for_enums: bool = False, descriptor_pool: DescriptorPool | None = None, float_precision: int | None = None, ) -> dict[str, Any]: ...
MessageToDict() including_default_value_fields argument has been deprecated and you'll need to use always_print_fields_with_no_presence.
json_data = MessageToDict( data, preserving_proto_field_name=True, always_print_fields_with_no_presence=True)
The problem occurs repetitively through multiple files in the ./fuzz directory.
source: 15703
No errors if Protobuf < 5.26.