Closed
Bug 1125592
Opened 11 years ago
Closed 11 years ago
Fix -Wmaybe-uninitialized warning in security/manager/ssl/src/nsNSSASN1Object.cpp
Categories
(Core :: Security: PSM, defect)
Tracking
()
RESOLVED
FIXED
mozilla38
People
(Reporter: cpeterson, Assigned: cpeterson)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.80 KB,
patch
|
keeler
:
review+
|
Details | Diff | Splinter Review |
getDERItemLength() can return error (len == -1) without initializing bytesUsed, so check for error before using bytesUsed:
security/manager/ssl/src/nsNSSASN1Object.cpp:131:22: warning: 'bytesUsed' may be used uninitialized in this function [-Wmaybe-uninitialized]
Attachment #8554239 -
Flags: review?(dkeeler)
![]() |
||
Comment 1•11 years ago
|
||
Comment on attachment 8554239 [details] [diff] [review]
Wuninitialized_nsNSSASN1Object.patch
Review of attachment 8554239 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with the suggested change. Thanks for taking care of this!
::: security/manager/ssl/src/nsNSSASN1Object.cpp
@@ +131,1 @@
> if ((len < 0) || ((data+len) > end))
Unfortunately 'data' is used in this expression. Let's do something like this:
if (len < 0) {
return NS_ERROR_FAILURE;
}
data += bytesUsed;
if (data + len > end) {
return NS_ERROR_FAILURE;
}
(although I suppose the other option is to use bytesUsed in the original expression)
Attachment #8554239 -
Flags: review?(dkeeler) → review+
Assignee | ||
Comment 2•11 years ago
|
||
Thanks. I landed the code you suggested:
https://hg.mozilla.org/integration/mozilla-inbound/rev/2b207b997e4c
Blocks: Wuninitialized
Comment 3•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in
before you can comment on or make changes to this bug.
Description
•