Skip to content

Commit

Permalink
fix codeql warning issue
Browse files Browse the repository at this point in the history
  • Loading branch information
benzfield committed Aug 31, 2023
1 parent 673d850 commit 8f71cd8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion emu/src/emulator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ int SDF_ExternalVerify_ECC(void *hSessionHandle,
ECCSignature *pucSignature) {
int ret = SDR_OK;
BN_CTX *ctx = nullptr;
BIGNUM *order, *R, *m, *X, *t, *x, *y, *r, *s;
BIGNUM *order = nullptr, *R = nullptr, *m = nullptr, *X = nullptr, *t = nullptr, *x = nullptr, *y = nullptr, *r = nullptr, *s = nullptr;
EC_POINT *point = nullptr;
EC_GROUP *ECgroup = EC_GROUP_new_by_curve_name(NID_sm2);
EC_POINT *pub_key = EC_POINT_new(ECgroup);
Expand Down
4 changes: 2 additions & 2 deletions src/session_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -459,11 +459,11 @@ std::vector<uint16_t> SessionFactory::updateWeightRoundTable(ConnectorType ct) {
} else if (ConnectorType::CT_TSS == ct) {
conns = &ts_connectors_;
}
if (conns != nullptr) {
if (conns != nullptr && conns->size() > 0) {
connector_round.resize(this->weight_sum_[static_cast<int>(ct)]);
weight_current_array.resize(conns->size());
for (int n = 0; n < this->weight_sum_[static_cast<int>(ct)]; n++) {
size_t maxSub;
size_t maxSub = 0;
for (size_t m = 0; m < conns->size(); m++) {
weight_current_array[m] += (*conns)[m]->getWeight();
if (m == 0 || (*conns)[m]->getWeight() > weight_current_array[maxSub]) {
Expand Down

0 comments on commit 8f71cd8

Please sign in to comment.