Closed
Bug 1234510
Opened 10 years ago
Closed 9 years ago
[CID 748763] modulo zero in p7local.c
Categories
(NSS :: Libraries, defect)
NSS
Libraries
Tracking
(firefox46 affected)
RESOLVED
FIXED
3.23
Tracking | Status | |
---|---|---|
firefox46 | --- | affected |
People
(Reporter: franziskus, Assigned: mds)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID748763)
Attachments
(3 files, 1 obsolete file)
969 bytes,
patch
|
franziskus
:
review+
franziskus
:
checked-in+
|
Details | Diff | Splinter Review |
1.13 KB,
patch
|
ttaubert
:
review+
|
Details | Diff | Splinter Review |
1.09 KB,
patch
|
ttaubert
:
review-
|
Details | Diff | Splinter Review |
sec_PKCS7Encrypt in p7local.c might do modulo zero (padsize).
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → michelangelo
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8720609 -
Flags: review?(franziskuskiefer)
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8720609 [details] [diff] [review]
Avoid modulo zero in sec_PKCS7Encrypt
Review of attachment 8720609 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Michelangelo wrote:
> to my knowledge a mod0 shoudln't
> happen over there, unless the compiler is "stupid enough" to not optmize
> the predicate.
that might be correct, but we probably shouldn't rely on it. And like this we can make coverity happy (and steve asked for something easy ;).
Attachment #8720609 -
Flags: review?(franziskuskiefer) → review+
Reporter | ||
Comment 3•9 years ago
|
||
Comment on attachment 8720609 [details] [diff] [review]
Avoid modulo zero in sec_PKCS7Encrypt
Review of attachment 8720609 [details] [diff] [review]:
-----------------------------------------------------------------
just noticed I messed up and gave you the wrong line...
You're right that the line I gave you in the e-mail is not a problem, but [1] is.
https://dxr.mozilla.org/mozilla-central/source/security/nss/lib/pkcs7/p7local.c#714
Attachment #8720609 -
Flags: review+
Assignee | ||
Comment 4•9 years ago
|
||
Attachment #8721087 -
Flags: review?(franziskuskiefer)
Assignee | ||
Updated•9 years ago
|
Attachment #8720609 -
Attachment is obsolete: true
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8721087 [details] [diff] [review]
Fix for mod0 in sec_PKCS7Encrypt
Review of attachment 8721087 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8721087 -
Flags: review?(franziskuskiefer) → review+
Reporter | ||
Comment 6•9 years ago
|
||
Comment on attachment 8721087 [details] [diff] [review]
Fix for mod0 in sec_PKCS7Encrypt
https://hg.mozilla.org/projects/nss/rev/438462e134c1
Attachment #8721087 -
Flags: checked-in+
Assignee | ||
Comment 7•9 years ago
|
||
Nice, thank you Franziskus!
Assignee | ||
Comment 8•9 years ago
|
||
Should we close this now?
Sorry, just asking out of ignorance: I'm not sure about the workflow in this case.:)
Reporter | ||
Comment 9•9 years ago
|
||
right, I marked it as resolved and set tracking for 3.23 (the next NSS release)
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 3.23
Comment 10•9 years ago
|
||
This is a better fix. The current fix adds a build warning.
Attachment #8728322 -
Flags: review?(franziskuskiefer)
Comment 11•9 years ago
|
||
I'll let you pick which one of these looks best, I think that this might be better.
Attachment #8728339 -
Flags: review?(franziskuskiefer)
Comment 12•9 years ago
|
||
Comment on attachment 8728339 [details] [diff] [review]
bug1234510v2.patch
Review of attachment 8728339 [details] [diff] [review]:
-----------------------------------------------------------------
::: lib/pkcs7/p7local.c
@@ +710,5 @@
> PORT_Memcpy (pbuf, input + ifraglen, pcount);
> }
>
> if (final) {
> + padlen = padsize - (pcount % padsize);
This would bring back mod zero, let's use the other patch.
Attachment #8728339 -
Flags: review?(franziskuskiefer) → review-
Updated•9 years ago
|
Attachment #8728322 -
Flags: review?(franziskuskiefer) → review+
Comment 13•9 years ago
|
||
Assignee | ||
Comment 14•9 years ago
|
||
(In reply to Martin Thomson [:mt:] from comment #10)
> The current fix adds a build warning.
Do you have a dump of the warning?
Reporter | ||
Comment 15•9 years ago
|
||
(In reply to Michelangelo De Simone from comment #14)
> (In reply to Martin Thomson [:mt:] from comment #10)
>
> > The current fix adds a build warning.
>
> Do you have a dump of the warning?
See bug 1254406 comment 3.
You need to log in
before you can comment on or make changes to this bug.
Description
•