Skip to content

put_str: Use memcpy instead of strncpy - #18627

Closed
t8m wants to merge 1 commit into
openssl:masterfrom
t8m:fix-strict-warning-strncpy
Closed

t8m wants to merge 1 commit into
openssl:masterfrom
t8m:fix-strict-warning-strncpy

Conversation

@t8m

@t8m t8m commented Jun 22, 2022

Copy link
Copy Markdown
Member

This fixes a warning from latest gcc.

There is no point in using strncpy here as we
intentionally copy only the string contents without
the terminating NUL. The len is set from strlen().

This fixes a warning from latest gcc.

There is no point in using strncpy here as we
intentionally copy only the string contents without
the terminating NUL. The len is set from strlen().
@t8m t8m added branch: master Applies to master branch approval: review pending This pull request needs review by a committer approval: otc review pending triaged: bug The issue/pr is/fixes a bug labels Jun 22, 2022
@github-actions github-actions Bot added the severity: fips change The pull request changes FIPS provider sources label Jun 22, 2022

@beldmit beldmit left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@beldmit beldmit added approval: done This pull request has the required number of approvals and removed approval: review pending This pull request needs review by a committer labels Jun 22, 2022
@openssl-machine openssl-machine added approval: ready to merge The 24 hour grace period has passed, ready to merge and removed approval: done This pull request has the required number of approvals labels Jun 23, 2022
@openssl-machine

Copy link
Copy Markdown
Collaborator

This pull request is ready to merge

openssl-machine pushed a commit that referenced this pull request Jun 23, 2022
This fixes a warning from latest gcc.

There is no point in using strncpy here as we
intentionally copy only the string contents without
the terminating NUL. The len is set from strlen().

Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Dmitry Belyavskiy <[email protected]>
(Merged from #18627)
@t8m

t8m commented Jun 23, 2022

Copy link
Copy Markdown
Member Author

Merged to master branch. Thank you for the reviews.

@t8m t8m closed this Jun 23, 2022
@thesamesam

thesamesam commented Jun 23, 2022 •

Copy link
Copy Markdown
Contributor

Thanks. This fixes one of the failures I noticed in #18639 w/ GCC 12.

sftcd pushed a commit to sftcd/openssl that referenced this pull request Sep 24, 2022
This fixes a warning from latest gcc.

There is no point in using strncpy here as we
intentionally copy only the string contents without
the terminating NUL. The len is set from strlen().

Reviewed-by: Matt Caswell <[email protected]>
Reviewed-by: Dmitry Belyavskiy <[email protected]>
(Merged from openssl#18627)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approval: ready to merge The 24 hour grace period has passed, ready to merge branch: master Applies to master branch severity: fips change The pull request changes FIPS provider sources triaged: bug The issue/pr is/fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants