If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

using %lld PR_scanf format directly on a PRTime is not portable

RESOLVED FIXED in mozilla2.0b1

Status

()

Toolkit
Places
RESOLVED FIXED
9 years ago
7 years ago

People

(Reporter: Martin Husemann, Assigned: Tobias Nygren)

Tracking

unspecified
mozilla2.0b1
Sun
NetBSD
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

9 years ago
Created attachment 353380 [details] [diff] [review]
portability fix

Consider a 64 bit arch (so %lld using a pointer to a 64 bit integer value) with PRTime as 32 bit type. This may (depending on endianess) give wrong results, and potentially overwrite other stack content.

Updated

9 years ago
Attachment #353380 - Flags: review-
Comment on attachment 353380 [details] [diff] [review]
portability fix

>-    if (PR_sscanf(values[kLastVisitColumn].get(), "%lld", &date) != 1) {
>+    long long ld;
Just change the PRTime to a PRInt64 please.
(Assignee)

Comment 2

7 years ago
Created attachment 448357 [details] [diff] [review]
updated patch

Added patch against mozilla-central with PRTime changed to PRInt64 as is done in other places in the tree where PR_sscanf + %lld is used to decode a timestamp.
Attachment #448357 - Flags: review?(hskupin)
Attachment #353380 - Attachment is obsolete: true
Assignee: nobody → tnn
Status: NEW → ASSIGNED
Comment on attachment 448357 [details] [diff] [review]
updated patch

Please re-ask for review from the person who already did the last review. Moving over to Shawn.
Attachment #448357 - Flags: review?(hskupin) → review?(sdwilsh)
Comment on attachment 448357 [details] [diff] [review]
updated patch

r=sdwilsh
Attachment #448357 - Flags: review?(sdwilsh) → review+

Updated

7 years ago
Keywords: checkin-needed
Created attachment 452892 [details] [diff] [review]
patch

correct patch format
Attachment #448357 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/efb517c91def
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a6
You need to log in before you can comment on or make changes to this bug.