Skip to content

Invalid check when moving line #2

Description

@oerdnj

Hey,

I believe the check here: https://github.com/conformal/backtrace/blob/master/libbacktrace/backtrace.c#L264

should in fact be:

if (csz >= sz - (current - (char *)rv)) {
...
}

Currently, as written, the condition can't ever be true because strlcpy() unless line[x] was not properly NULL terminated (e.g. runaway string), but you probably wanted to check if strlcpy() was able to fit the whole line[i] inside the cur buffer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions