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

Avoid flexible arrays on unsupported platforms via a macro. #7538

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kareem-wolfssl
Copy link
Contributor

@kareem-wolfssl kareem-wolfssl commented May 15, 2024

Description

Fixes zd#17977

Credit to wolfSentry for the fix

Customer to confirm fix, please do not merge before then

Testing

Built in tests with --enable-dtlscid --enable-tls13 --enable-tlsx --enable-dtls13 --enable-dtls which should cover all cases

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this May 15, 2024
@@ -3175,7 +3175,7 @@ typedef struct SignatureAlgorithms {
#ifdef _MSC_VER
#pragma warning(disable: 4200)
#endif
byte hashSigAlgo[]; /* sig/algo to offer */
byte hashSigAlgo[WOLFSSL_FLEXIBLE_ARRAY_SIZE]; /* sig/algo to offer */
Copy link
Contributor

Choose a reason for hiding this comment

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

[clang-tidy-defaults] [7 of 7] [ac3063c1e8]
    configure...   real 0m18.881s  user 0m5.668s  sys 0m2.801s
    build..../wolfssl/internal.h:3178:29: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte        hashSigAlgo[WOLFSSL_FLEXIBLE_ARRAY_SIZE]; /* sig/algo to offer */
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
./wolfssl/internal.h:3356:17: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte   data[WOLFSSL_FLEXIBLE_ARRAY_SIZE];
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
./wolfssl/internal.h:5216:14: warning: zero size arrays are an extension [clang-diagnostic-zero-length-array]
byte buf[WOLFSSL_FLEXIBLE_ARRAY_SIZE];
^
/tmp/workspace/PRB-multi-test-script/wolfssl/./wolfssl/wolfcrypt/wc_port.h:1276:41: note: expanded from macro 'WOLFSSL_FLEXIBLE_ARRAY_SIZE'
#define WOLFSSL_FLEXIBLE_ARRAY_SIZE 0
^
make[2]: *** [Makefile:7277: wolfcrypt/src/src_libwolfssl_la-asn.lo] Error 1
make[1]: *** [Makefile:8414: all-recursive] Error 1
make: *** [Makefile:5059: all] Error 2
   real 2m34.598s  user 2m0.813s  sys 0m2.866s
    clang-tidy-defaults fail_analytic_build
    failed config: 'CPPFLAGS=-DKEEP_OUR_CERT -DKEEP_PEER_CERT -DWOLFSSL_ALT_NAMES -DNO_WOLFSSL_CIPHER_SUITE_TEST -DWOLFSSL_OLD_PRIME_CHECK -pedantic -DSP_ALLOC -DWOLFSSL_CLANG_TIDY' 'CC=/tmp/workspace/PRB-multi-test-script/testing/git-hooks/clang-tidy-builder.sh' 'CLANG=/usr/lib/llvm-14/bin/clang-14' 'CFLAGS=-Wunreachable-code-aggressive -Wthread-safety -Wloop-analysis -Wenum-compare-conditional -fcolor-diagnostics -fcomplete-member-pointers -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -g -fdebug-types-section -Wunreachable-code-break -Wunreachable-code-return -Wimplicit-fallthrough'
final tally: 6 of 7 checks succeeded, 0 skipped, 0 forced, and 1 failed, for ac3063c1e8.
exiting with status 2

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