Skip to content

Commit

Permalink
src/internal.c: in wolfSSL_ERR_reason_error_string(), jump to unknown…
Browse files Browse the repository at this point in the history
…_error_number when error==0 and !OPENSSL_EXTRA, to avoid provoking clang-analyzer-optin.core.EnumCastOutOfRange.
  • Loading branch information
douzzer committed Aug 30, 2024
1 parent 13ec0f0 commit c2f5591
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25165,11 +25165,13 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
return wc_GetErrorString(error);
}

#ifdef OPENSSL_EXTRA
if (error == 0) {
#ifdef OPENSSL_EXTRA
return "ok";
}
#else
goto unknown_error_number;
#endif
}

switch ((enum wolfSSL_ErrorCodes)error) {

Expand Down Expand Up @@ -25730,6 +25732,7 @@ const char* wolfSSL_ERR_reason_error_string(unsigned long e)
}
#endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL || HAVE_WEBSERVER || HAVE_MEMCACHED */

unknown_error_number:
return "unknown error number";

#endif /* NO_ERROR_STRINGS */
Expand Down

0 comments on commit c2f5591

Please sign in to comment.