Skip to content

lab6b (ASLR) | Newlines are not being removed from user input fields #40

@SharonBrizinov

Description

@SharonBrizinov

fgets(readbuff, sizeof(readbuff), stdin);

Newlines are not being removed from any user input (both for username and password). Therefore, unless they are both 32 bytes long, they will never match the actual fields because of the '\n' difference.

I suggest adding this after both fgets calls:
readbuff[strcspn(readbuff, "\n")] = 0;

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