Skip to content

[defect]: Two random bugs in rlm_ftp.c #5669

@MegaManSec

Description

@MegaManSec

What type of defect/bug is this?

Unexpected behaviour

How can the issue be reproduced?

While working on #5668, I came across what I think are three bugs. I didn't want to make PRs for them because I might be wrong but, I thought better to create a single issue. All issues relate to github.com/FreeRADIUS/freeradius-server/blob/7e538657fe05325cbd84453fc034d3a9b8598735/src/modules/rlm_ftp/rlm_ftp.c.

  1. The wrong variable is logged in here:
    if ((ctx->instance->max_resp_size > 0) && ((ctx->used + (end - p)) > ctx->instance->max_resp_size)) {
    REDEBUG("Incoming data (%zu bytes) exceeds max_body_in (%zu bytes). "
    "Forcing body to type 'invalid'", ctx->used + (end - p), ctx->instance->max_resp_size);
  2. I think this is missing a curl_ctx->response.request = request; https://github.com/FreeRADIUS/freeradius-server/blob/7e538657fe05325cbd84453fc034d3a9b8598735/src/modules/rlm_ftp/rlm_ftp.c#L296C2-L296C17 so this works https://github.com/FreeRADIUS/freeradius-server/blob/7e538657fe05325cbd84453fc034d3a9b8598735/src/modules/rlm_ftp/rlm_ftp.c#L209C14-L209C21

Log output from the FreeRADIUS daemon

n/a

Relevant log output from client utilities

No response

Backtrace from LLDB or GDB

Metadata

Metadata

Assignees

Labels

defectcategory: a defect or misbehaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions