Occurences of uninitialized variables being used before being set (in security/nss/lib)

RESOLVED FIXED in 3.8

Status

P2
normal
RESOLVED FIXED
17 years ago
16 years ago

People

(Reporter: mozilla-bugs, Assigned: wtc)

Tracking

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

17 years ago
This bug is just for the "xxx might be used uninitialized" warnings in various
source files in security/nss/lib directory.
Currently
(http://tinderbox.mozilla.org/showlog.cgi?log=SeaMonkey/1021514880.29242.gz&fulltext=1
- Wed, 15 May 2002 22:08 -0400) brad TBox shows the following warnings (although
for some reason TBox only shows the file names, but not the directories):

security/nss/lib/dev/devtoken.c:279
 `status' might be used uninitialized in this function

security/nss/lib/dev/devtoken.c:487
 `objclass' might be used uninitialized in this function

security/nss/lib/dev/devtoken.c:1085
 `t' might be used uninitialized in this function

security/nss/lib/dev/devutil.c:1059
 `oi' might be used uninitialized in this function

security/nss/lib/dev/devutil.c:1061
 `match' might be used uninitialized in this function

P.S. A similar bug for a previous version of NSS is bug 119376.
(Reporter)

Comment 1

17 years ago
Bug 59652 is the meta-bug tracking the fight against these (potentially very
nasty) warnings.
Blocks: 59652
(Reporter)

Comment 2

16 years ago
Current list of warnings is:

security/nss/lib/pk11wrap/pk11cert.c:2259
 `cert' might be used uninitialized in this function

security/nss/lib/smime/smimeutil.c:241
 `c' might be used uninitialized in this function

security/nss/lib/softoken/dbmshim.c:353
 `len' might be used uninitialized in this function

Updated

16 years ago
Summary: Occurances of uninitialized variables being used before being set (in security/nss/lib) → Occurences of uninitialized variables being used before being set (in security/nss/lib)
(Assignee)

Updated

16 years ago
Status: NEW → ASSIGNED
Priority: -- → P2
Target Milestone: --- → 3.7
(Assignee)

Comment 3

16 years ago
Created attachment 109704 [details] [diff] [review]
Proposed patch

I reviewed all the uninitialized variable warnings generated
by gcc on Linux in the nss/lib directory and the subdirectories
under nss/cmd: certutil, modutil, signtool, cmsutil, selfserv,
strsclnt, and tstclnt.	(Note: you must build with BUILD_OPT=1
for gcc to generate the 'xxx might be used uninitialized'
warnings.  I don't know why.)

None of them are bugs.	So it is not required to check in this
patch before 3.7 RTM.
(Reporter)

Comment 4

16 years ago
> Note: you must build with BUILD_OPT=1
> for gcc to generate the 'xxx might be used uninitialized'
> warnings.  I don't know why.

gcc only builds a data flow graph during the optimization stage. When buildig a
graph, it can notice "bad" paths in it and report those as warnings. No
optimization -> no data flow graph -> no warnings...
(Assignee)

Updated

16 years ago
Target Milestone: 3.7 → 3.7.1
(Assignee)

Comment 5

16 years ago
Created attachment 109806 [details] [diff] [review]
Proposed patch v2 for the NSS_3_7_BRANCH

When reviewing this patch, please do the following.

1. Verify that none of these "might be used uninitialized"
warnings are real bugs.

2. Verify that my fixes are correct.  In some places I
get rid of the warnings by ways other than initializing
the variables.
Attachment #109704 - Attachment is obsolete: true
(Assignee)

Comment 6

16 years ago
Created attachment 111789 [details] [diff] [review]
Proposed patch for the tip (3.8)
(Assignee)

Updated

16 years ago
Attachment #109806 - Attachment description: Proposed patch v2 → Proposed patch v2 for the NSS_3_7_BRANCH
(Assignee)

Comment 7

16 years ago
The patch for the tip of NSS has been checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
Target Milestone: 3.7.1 → 3.8
You need to log in before you can comment on or make changes to this bug.