#9903 Potential null dereference issues
Opened by anchels. Modified

Issue

  1. Null check in function CHOICE_free() doesn't prevent the td pointer from potential null dereference.

  2. get_config_entry(): the return value tmp of function strndup is dereferenced without checking for null (also here), but it is usually checked for this function. Notice that function strndup may return null in case of memory allocation problems. It might be also worth adding a null check for data to be on the safe side.

Actual behavior

Null dereference may lead to undefined behaviour

Expected behavior

Before dereference, pointers are checked for null


Thank you for the report.

I'm working on addressing old asn1c code by rewriting our ASN.1-using code completely. It takes some time but I already have client side re-implemented in Rust using a new ASN.1 library I've wrote with codegenerated Rust code.

It will more time to get this upstream but this is a direction we plan to go. 389-ds plugins on the server side will move to this direction as well. 389-ds has Rust-based plugin API which is already available in all supported FreeIPA versions.

I'll keep this bug open to track the integration work.

Metadata