cve-bin-tool icon indicating copy to clipboard operation
cve-bin-tool copied to clipboard

fix: TypeError in fuzz_python_requirement_parser in fuzzing reports

Open joydeep049 opened this issue 10 months ago • 3 comments

Related #4045 Related to fuzzing run https://github.com/intel/cve-bin-tool/actions/runs/8595897802. 18 04 2024_23 43 49_REC

joydeep049 avatar Apr 18 '24 18:04 joydeep049

This TypeError seems kinda strange because google.protobuf.json_format.MessageToDict does contain the argument including_default_value_fields 18 04 2024_23 47 02_REC Source: https://googleapis.dev/python/protobuf/latest/google/protobuf/json_format.html

joydeep049 avatar Apr 18 '24 18:04 joydeep049

@terriko I want to work on this issue. Can you assign me please?

ranjanmangla1 avatar Apr 25 '24 18:04 ranjanmangla1

@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 avatar Apr 25 '24 20:04 terriko

@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

protobuf.dev

No errors if Protobuf < 5.26.

hassaanshafqatt avatar Aug 05 '24 10:08 hassaanshafqatt