Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc 8.3 warning (stringop-truncation) #489

Merged
merged 1 commit into from
Jun 9, 2019

Conversation

karel-m
Copy link
Member

@karel-m karel-m commented Jun 6, 2019

Warning related to ssh_encode_sequence_multi.c

In file included from src/headers/tomcrypt.h:22,
                 from src/headers/tomcrypt_private.h:10,
                 from src/misc/ssh/ssh_encode_sequence_multi.c:9:
src/misc/ssh/ssh_encode_sequence_multi.c: In function 'ssh_encode_sequence_multi':
src/headers/tomcrypt_custom.h:49:18: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
 #define XSTRNCPY strncpy
src/misc/ssh/ssh_encode_sequence_multi.c:124:13: note: in expansion of macro 'XSTRNCPY'
             XSTRNCPY((char *)out, sdata, size);
             ^~~~~~~~
src/misc/ssh/ssh_encode_sequence_multi.c:121:20: note: length computed here
             size = strlen(sdata);
                    ^~~~~~~~~~~~~

@karel-m karel-m requested a review from sjaeckel June 6, 2019 18:49
@sjaeckel sjaeckel force-pushed the pr/fix-stringop-truncation branch from b8bd924 to 5f09c2c Compare June 9, 2019 09:40
@sjaeckel sjaeckel merged commit c600d81 into develop Jun 9, 2019
@sjaeckel sjaeckel deleted the pr/fix-stringop-truncation branch June 9, 2019 09:40
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.

None yet

2 participants