Remove -Wmaybe-uninitialized warning in pqg.c
Categories
(NSS :: Build, defect, P2)
Tracking
(Not tracked)
People
(Reporter: giulio.benetti, Assigned: giulio.benetti)
Details
Attachments
(1 file, 1 obsolete file)
1.65 KB,
patch
|
marcus.apb
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Steps to reproduce:
make nss_build_all BUILD_OPT=1 ALLOW_OPT_CODE_SIZE=1 OPT_CODE_SIZE=1 NSS_BUILD_SOFTOKEN_ONLY=1
Actual results:
pqg.c: In function ‘PQG_VerifyParams’:
pqg.c:1806:27: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if ((vfy->h.len == 1) && (type != FIPS186_1_TYPE)) {
^
In file included from pqg.c:21:0:
secmpi.h:8:8: error: ‘hashtype’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (SECSuccess != (rv = func))
^
pqg.c:1624:19: note: ‘hashtype’ was declared here
HASH_HashType hashtype;
^
cc1: all warnings being treated as errors
Expected results:
No warnings at all.
Assignee | ||
Comment 1•5 years ago
|
||
This patch fixes the warning.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Comment on attachment 9074171 [details] [diff] [review] 0001-Bug-1561598-Remove-Wmaybe-uninitialized-warning-in-p.patch Hi Giulio, Thanks to inform and suggest a fix. There are other places where this variable can be initialized too. https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/pqg.c#893 https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/pqg.c#1242 https://searchfox.org/mozilla-central/source/security/nss/lib/freebl/pqg.c#1633 Could you update the patch, please? It would be better if you send the patch using moz-php. https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html Thanks,
Comment 3•5 years ago
|
||
Comment on attachment 9074171 [details] [diff] [review] 0001-Bug-1561598-Remove-Wmaybe-uninitialized-warning-in-p.patch Review of attachment 9074171 [details] [diff] [review]: ----------------------------------------------------------------- There are other places with the same variable that should be fixed together.
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Hi Marcus,
above is the patch requested with no newline. I attach a new one. Sorry.
Assignee | ||
Comment 6•5 years ago
|
||
(In reply to Giulio Benetti from comment #5)
Hi Marcus,
above is the patch requested with no newline. I attach a new one. Sorry.
Nope, it's ok as it is.
Assignee | ||
Comment 7•5 years ago
|
||
Kindly ping.
Comment 8•5 years ago
|
||
Comment on attachment 9078361 [details] [diff] [review] v2-0001-Bug-1561598-Remove-Wmaybe-uninitialized-warning-in-p.patch Thanks Giulio.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•5 years ago
|
||
Comment 10•5 years ago
|
||
Thanks again Giulio for these patches!
Assignee | ||
Comment 11•5 years ago
|
||
You're welcome, it's been a pleasure contributing with these patches :)
Description
•