Skip to content

The return pointer of bsearch function should have bounds declared #559

Open
@secure-sw-dev-bot

Description

@secure-sw-dev-bot

This issue was copied from checkedc/checkedc-clang#560


  • The bsearch function is a polymorphic generic function in checked c whose return type is _Ptr where T is defined at callsites
  • Currently we cannot provide bounds for the returned pointer. Ideally we would want the return pointer to be, _Array_ptr with bounds (base, (char *)base + (size * nmemb)).

This will make sure that the returned pointer is actually within the bounds of the input array on which the search is made.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions