Skip to content

Commit

Permalink
src/internal.c: in wolfSSL_ERR_reason_error_string(), return "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 126df1d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 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
return "unknown error number";
#endif
}

switch ((enum wolfSSL_ErrorCodes)error) {

Expand Down

0 comments on commit 126df1d

Please sign in to comment.