Skip to content

curlx_strtoofft() doesn't fully protect against null "str" argument #1950

@bnason-nf

Description

@bnason-nf

With curl 7.46.0, in curlx_strtoofft(), there is a check for a null "str" argument, but the remaining lines of the function don't guard against null. Currently, it it would cause a null pointer dereference if str were ever null.

So, either the first condition in this while loop is unnecessary if str can never be null:

while(str && *str && ISSPACE(*str))

Or the remaining code should be changed to handle a null str argument (maybe just an early out at the top of the function would be simplest).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions