Repository navigation
Correctly initialize values - #1428
Conversation
Fix regression with commit from #1421
Fix warnings
|
@willco007: It just dawned on me that these initializations were pretty much always missing from the code. The crashes you've seen might have a different reason. Unless mbedTLS changed how the This PR is fine either way. Ref: 2e4c5ec |
|
The crash I saw was reported by the fuzzer but marked as not reproducible, however it first appeared from the commit for #1421. It seems it just happened to hit the uninitialized variables on that run?? |
|
#1421 basically reverted the earlier 2e4c5ec, with the manual declaration added for the most recent mbedTLS version. It gets more interesting because this was indeed wrong, but it was wrong all along before these commits: mbedTLS does indeed leave these variables unitialized on failure, by looking at 3.5.0: One explanantion is that the manual declaration triggered the fuzzer to extend into this mbedTLS function. Makes me think how many more of these may exist out of view of the fuzzer. edit: it's probably a good idea to always initialize variables passed by address. |
|
I quickly scrubbed mbedtls.c and didn't see any more uninitialized variables, but I did find this error case #1430. |
|
Nice! |
Fix regression with commit from #1421