Skip to content

Bugs report #6

@songxpu

Description

@songxpu

There is a small bug in server.c:173

void ftp_mkd(Command *cmd, State *state)
{
  char res[2*BSIZE+32]; 
  ...
  state->message = res;
  ...
  state->message = "550 Failed to create directory. Check path or permissions.\r\n";  // local address
  ...
  write_state(state);
}

void write_state(State *state)
{
  write(state->connection, state->message, strlen(state->message)); // bug location: read previous local address
}

ASAN
image

Reproduce

USER anonymous
PASS anonymous
MKD <filename> // filename should not be existed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions