Skip to content

Potential unsafe operation on data returned from fgets #50

@musteresel

Description

@musteresel

wsapi/src/fastcgi/lfcgi.c

Lines 365 to 366 in 8bbfe70

l = strlen(p);
if (p[l-1] != '\n')

The buffer may contain a zero byte; which may even be at the beginning. This causes strlen to return 0, and thus (size_t) 0 - 1 will result in SIZE_MAX and thus cause an out of buffer access

See https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?pageId=87152422

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