Skip to content

initialize values used by unsigned bin#9173

Closed
rlm2002 wants to merge 1 commit intowolfSSL:masterfrom
rlm2002:uninitVar_codeSonar
Closed

initialize values used by unsigned bin#9173
rlm2002 wants to merge 1 commit intowolfSSL:masterfrom
rlm2002:uninitVar_codeSonar

Conversation

@rlm2002
Copy link
Copy Markdown
Contributor

@rlm2002 rlm2002 commented Sep 8, 2025

Description

Adds loop to initialize a->dp[i] to 0 in sp_read_unsigned_bin() for a->used.

Testing

./configure && make check

@rlm2002 rlm2002 force-pushed the uninitVar_codeSonar branch from 8c79baa to 29e0af3 Compare September 8, 2025 23:05
@rlm2002
Copy link
Copy Markdown
Contributor Author

rlm2002 commented Sep 9, 2025

Retest this please Jenkins: java.io.StreamCorruptedException and Timeout

@rlm2002 rlm2002 marked this pull request as ready for review September 9, 2025 17:13
@dgarske dgarske requested a review from SparkiDev September 9, 2025 19:08
Comment thread wolfcrypt/src/sp_int.c Outdated
@dgarske dgarske assigned rlm2002 and unassigned SparkiDev Sep 9, 2025
@rlm2002 rlm2002 force-pushed the uninitVar_codeSonar branch from 453ca66 to 8e91e6a Compare September 9, 2025 20:35
Comment thread wolfcrypt/src/sp_int.c
a->dp[j++] = *(sp_int_digit*)(in + i - (SP_WORD_SIZEOF - 1));
}
#else
for (i = 0; i < (int)a->used; i++) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't want to do this.
We are reading in bytes to create digits and the used will be updated to the length of the created digits.
Need to analyse the problem more deeply.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Going back to the drawing board.

@rlm2002 rlm2002 marked this pull request as draft September 9, 2025 22:48
@rlm2002
Copy link
Copy Markdown
Contributor Author

rlm2002 commented Mar 9, 2026

Closing lingering PR. May reopen if issue at later date.

@rlm2002 rlm2002 closed this Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants