Skip to content

TFTP OACK not compliant with TFTP Specification #43

@PaulMaurer

Description

@PaulMaurer

After Testing Uftpd with some Cisco Switches i noticed a weird behaviour that some Switches deny the OACK Package because of malformated information. After taking a look i noticed that there are some extra NULL Bytes at the end of the TFTP Option Part which dont belong there.
00 06 62 6c 6b 73 69 7a 65 00 38 31 39 32 00 00 00 00 00

While searching through the Code i noticed the following section:

ptr = &ctrl->th->th_stuff[0];
	if (isset(&ctrl->tftp_options, 1)) {
		ptr += sprintf(ptr, "blksize");
		ptr ++;

		ptr += sprintf(ptr, "%zd", ctrl->segsize);
		ptr ++;
	}

in which the second ptr ++ is causing the issue from my point of understanding.

Thanks in advance

Best Paul

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