Skip to content

tool_doswin: simplify; remove unused options and strncpy calls#15047

Closed
bagder wants to merge 1 commit intomasterfrom
bagder/doswin-simplify
Closed

tool_doswin: simplify; remove unused options and strncpy calls#15047
bagder wants to merge 1 commit intomasterfrom
bagder/doswin-simplify

Conversation

@bagder
Copy link
Copy Markdown
Member

@bagder bagder commented Sep 26, 2024

SANITIZE_ALLOW_TRUNCATE and SANITIZE_ALLOW_COLONS were never used by code, thus only making the code complicated for no good use.

Since nothing should truncate, using strncpy() is wrong.

Two cases of malloc + copy replaced with proper strdup() calls.

Fixup unit test 1604 accordingly.

@github-actions github-actions bot added the tests label Sep 26, 2024
@bagder bagder changed the title tool_doswin: simply; remove unused options and strncpy calls tool_doswin: simplify; remove unused options and strncpy calls Sep 26, 2024
@dfandrich

This comment was marked as outdated.

SANITIZE_ALLOW_TRUNCATE and SANITIZE_ALLOW_COLONS were never used by
code, thus only making the code complicated for no good use.

Since nothing should truncate, using strncpy() is wrong.

Two cases of malloc + copy replaced with proper strdup() calls.

Fixup unit test 1604 accordingly.

Closes #15047
@bagder bagder force-pushed the bagder/doswin-simplify branch from 4045f15 to f383a17 Compare September 26, 2024 08:45
@bagder bagder closed this in f383a17 Sep 26, 2024
@bagder bagder deleted the bagder/doswin-simplify branch September 26, 2024 11:10
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
SANITIZE_ALLOW_TRUNCATE and SANITIZE_ALLOW_COLONS were never used by
code, thus only making the code complicated for no good use.

Since nothing should truncate, using strncpy() is wrong.

Two cases of malloc + copy replaced with proper strdup() calls.

Fixup unit test 1604 accordingly.

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

Development

Successfully merging this pull request may close these issues.

2 participants