Skip to content

re-use of free'd memory causes hard crash #23

Open
@jwbmwv

Description

@jwbmwv

If an ftp client send a RETR closely followed by an ABOR memory is freed in the cmd_abrt() -> tcp->abort() -> tcp->abandon() -> ftpd_msgerr() -> ftpd_dataclsoe() call sequence that cmd_abrt subsequently tries to use/free again. Taking the code to free memory out of cmd_abrt() fixes the crash, but causes a memory leak as expected. I believe the fundamental problem is the callbacks used do not have the ability to propagate the freeing of the memory back up the call return stack. Some one of the calling functions need to know enough to invalidate a pointer somewhere.

This was found by implementing the SIZE command and issuing a curl command that had a range starting at offset 0.

curl ftp://ip_address/filename --range 0-1000 -o /tmp/out.tx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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