Closed Bug 1415718 Opened 7 years ago Closed 7 years ago

Uninitialized version warning in ssl3_SendClientHello

Categories

(NSS :: Libraries, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mt, Assigned: mt)

Details

Attachments

(2 files)

Gecko builds use a different set of warning flags, and aside from signed/unsigned comparison warnings (of which we still have many), they throw out this.


 0:03.26 .../mozilla-inbound/security/nss/lib/ssl/ssl3con.c: In function ‘ssl3_SendClientHello’:
 0:03.26 .../mozilla-inbound/security/nss/lib/ssl/ssl3con.c:5224:69: warning: ‘version’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 0:03.26      fallbackSCSV = ss->opt.enableFallbackSCSV && (!requestingResume ||
 0:03.26                                                   ~~~~~~~~~~~~~~~~~~~^~
 0:03.26                                                    version < sid->version);
 0:03.26                                                    ~~~~~~~~~~~~~~~~~~~~~~~

This is actually wrong.  The test is never run with an uninitialized `version`, but if you look at the code, you can appreciate why the compiler has trouble recognizing this.

Better to initialize the value properly from the outset and use the various tests throughout the function to drive the value downwards.
Comment on attachment 8926609 [details]
Bug 1415718 - Initialize version in ssl3_SendClientHello, r?ttaubert

Tim Taubert [:ttaubert] has approved the revision.

https://phabricator.services.mozilla.com/D208#5189
Attachment #8926609 - Flags: review+
https://hg.mozilla.org/projects/nss/rev/5b6c6551931f46228c82285dec1969687f9dd47a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: