Skip to content

Commit 0f99f4e

Browse files
authored
Implement coverity suggestions (#2730)
### Issues: Addresses P311843643 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
1 parent 4f2a89a commit 0f99f4e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tool-openssl/dgst.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ static std::string GetSigName(int nid) {
113113
case EVP_PKEY_EC:
114114
return "ECDSA";
115115

116-
default:
116+
default: {
117117
/* Try to output provider-registered sig alg name */
118-
return OBJ_nid2sn(nid);
118+
const char* name = OBJ_nid2sn(nid);
119+
return name ? std::string(name) : "UNKNOWN";
120+
}
119121
}
120122
}
121123

tool-openssl/ordered_args.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ bool GetBoolArgument(bool *out, const std::string &arg_name,
149149
bool GetExclusiveBoolArgument(std::string *out_arg, const argument_t *templates,
150150
std::string default_out_arg,
151151
const ordered_args_map_t &args) {
152-
*out_arg = default_out_arg;
152+
*out_arg = std::move(default_out_arg);
153153

154154
for (size_t i = 0; templates[i].name[0] != 0; i++) {
155155
const argument_t *templ = &templates[i];

0 commit comments

Comments
 (0)