Closed Bug 1235188 Opened 10 years ago Closed 10 years ago

Fix -Wformat warnings in security/certverifier/

Categories

(Core :: Security, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox46 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

Details

Attachments

(1 file, 1 obsolete file)

security/certverifier/NSSCertDBTrustDomain.cpp:433:26 [-Wformat] format specifies type 'long' but the argument has underlying type 'int' security/certverifier/NSSCertDBTrustDomain.cpp:433:48 [-Wformat] format specifies type 'long long' but the argument has type 'mozilla::pkix::Time' pkix::Time is an object. I added a new elapsedSecondsDebug() member function to peek at Time's elapsedSecondsAD member variable. Since this is break the Time abstraction, I hid the new member function behind #ifdef DEBUG so no one is tempted to use it in release code. Alternatively, the MOZ_LOG() call could be changed to not log cachedResponseValidThrough.
Attachment #8702034 - Flags: review?(dkeeler)
Comment on attachment 8702034 [details] [diff] [review] security-certverifier_Wformat.patch Review of attachment 8702034 [details] [diff] [review]: ----------------------------------------------------------------- Yeah, let's just go with the alternative and remove logging cachedResponseValidThrough (we don't log other pkix::Times as far as I recall, and the format isn't readily comparable to other ways of obtaining the time, so I don't think it's that useful).
Attachment #8702034 - Flags: review?(dkeeler) → review-
Patch v2: Fix two -Wformat warnings in certverifier by downgrading %ld format specifier to %d and removing cachedResponseValidThrough. security/certverifier/NSSCertDBTrustDomain.cpp:433:26 [-Wformat] format specifies type 'long' but the argument has underlying type 'int' security/certverifier/NSSCertDBTrustDomain.cpp:433:48 [-Wformat] format specifies type 'long long' but the argument has type 'mozilla::pkix::Time'
Attachment #8702034 - Attachment is obsolete: true
Attachment #8705963 - Flags: review?(dkeeler)
Comment on attachment 8705963 [details] [diff] [review] certverifier-Wformat-v2.patch Review of attachment 8705963 [details] [diff] [review]: ----------------------------------------------------------------- Great - thanks.
Attachment #8705963 - Flags: review?(dkeeler) → review+
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: