Closed
Bug 735306
Opened 14 years ago
Closed 14 years ago
Mistake in certcgi.c source code
Categories
(NSS :: Tools, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: guy_vaessen, Assigned: guy_vaessen)
Details
Attachments
(1 file)
|
788 bytes,
patch
|
briansmith
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8; .NET4.0C)
Steps to reproduce:
Ran cppcheck V1.52: it found a bug in certcgi.c
More specific: security\nss\cmd\certcgi\certcgi.c at row :1432
The code in question is: if (value >= 0 || value < 256) {
This is alway's true! That can't be a usefull check!
The reported error by cppcheck is: (warning) Mutual exclusion over || always evaluates to true. Did you intend to use && instead?
Actual results:
Verified the reported error of cppcheck.
In this case cppcheck is right, && should have been used.
Expected results:
Replace || with && on:
security\nss\cmd\certcgi\certcgi.c at row :1432
--if (value >= 0 || value < 256) {
++if (value >= 0 && value < 256) {
OR remove this entire check. (The check is useless, so it needs to be modified or removed.)
Updated•14 years ago
|
Assignee: nobody → nobody
Component: Security → Tools
Product: Core → NSS
QA Contact: toolkit → tools
Version: Trunk → trunk
Comment 1•14 years ago
|
||
Guy do you feel like making a patch ?
patch for bug 735306 /r
Updated•14 years ago
|
Assignee: nobody → guy_vaessen
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Updated•14 years ago
|
Attachment #605514 -
Flags: review?(bsmith)
Comment 3•14 years ago
|
||
Attachment #605514 -
Flags: review?(bsmith) → review+
Comment 5•14 years ago
|
||
Guy, thank you for your contribution (although this code might no longer be in use).
Checking in certcgi/certcgi.c;
/cvsroot/mozilla/security/nss/cmd/certcgi/certcgi.c,v <-- certcgi.c
new revision: 1.22; previous revision: 1.21
done
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Keywords: checkin-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•