Skip to content

Commit

Permalink
common/nutwriter.cpp: serializeCertHost(): try to avoid "may be used …
Browse files Browse the repository at this point in the history
…uninitialized in this function" warnings [networkupstools#2294, networkupstools#2433]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed May 6, 2024
1 parent 050e101 commit 2b46c21
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions common/nutwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,10 @@ static std::string serializeCertHost(const nut::CertHost & certHost) {
// need to add relaxed mode for 0/1 as false/true handling:
//bi.bool01 = true;

// Avoid static analysis concerns that the internal _value
// "may be used uninitialized in this function" (ETOOSMART):
bi = false;

// Assumed to be set() - exception otherwise
bi = certHost.certVerify;
bi.bool01 = true;
Expand Down

0 comments on commit 2b46c21

Please sign in to comment.