Skip to content

Conversation

@jonrebm
Copy link
Contributor

@jonrebm jonrebm commented Dec 14, 2025

The previous implementation was unable to handle any command sequences split across the (maximum) 1024 bytes buffers, leading to crashes, out-of-bounds access and data corruption.

The previous implementation went into great detail handling plenty of command strings but only provided stubs debug-printing those commands.

To keep the code concise, the debug-prints in the new version are just a hexdump of all command sequences it extracts from the bytestream (regardless of whether they're handled or not). There are no more stubs for individual unsupported command sequences.

The previous implementation was unable to handle any command sequences
split across the (maximum) 1024 bytes buffers, leading to crashes,
out-of-bounds access and data corruption.

The previous implementation went into great detail handling plenty of
command strings but only provided stubs debug-printing those commands.

To keep the code concise, the new version prints a hexdump of all
command sequences it extracts from the bytestream (regardless of whether
they're handled or not).

Signed-off-by: Jonas Rebmann <[email protected]>
@jonrebm jonrebm marked this pull request as draft December 14, 2025 20:57
char connected_host[256], connected_port[30];

ios = malloc(sizeof(*ios));
ios = calloc(1, sizeof(struct telnet_ios));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer you allocate telnet_ios here, then add a ios = &telnet_ios->base after the NULL check. Otherwise, anyone looking for future issues will stumble upon this and will have to verify themselves that this is kosher.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants