Skip to content

Conversation

@JacobBarthelmeh
Copy link
Contributor

gcc version 15.2.0 (GCC)

Fixes the following warning with --enable-all build:

apps/wolfsshd/test/test_configuration.c: In function 'CleanupWildcardTest':
./wolfssh/port.h:582:55: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 506 [-Werror=format-truncation=]
  582 |         #define WSNPRINTF(s,n,f,...) snprintf((s),(n),(f),##__VA_ARGS__)
      |                                                       ^~~
apps/wolfsshd/test/test_configuration.c:46:17: note: in expansion of macro 'WSNPRINTF'
   46 |                 WSNPRINTF(filepath, sizeof filepath, "%s%s",
      |                 ^~~~~~~~~
./wolfssh/port.h:582:38: note: '__builtin_snprintf' output between 17 and 1040 bytes into a destination of size 522
  582 |         #define WSNPRINTF(s,n,f,...) snprintf((s),(n),(f),##__VA_ARGS__)
      |                                      ^~~~~~~~
apps/wolfsshd/test/test_configuration.c:46:17: note: in expansion of macro 'WSNPRINTF'
   46 |                 WSNPRINTF(filepath, sizeof filepath, "%s%s",
      |                 ^~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [apps/wolfsshd/test/test_configuration-test_configuration.o] Error 1

@dgarske dgarske merged commit af1dac9 into wolfSSL:master Jan 9, 2026
93 checks passed
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.

3 participants