Closed Bug 1486386 Opened 6 years ago Closed 3 years ago

cairo-type1-subset.c uses isxdigit()

Categories

(Core :: Graphics, defect, P3)

Unspecified
Linux
defect

Tracking

()

RESOLVED FIXED
92 Branch
Tracking Status
firefox92 --- fixed

People

(Reporter: hsivonen, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

(Whiteboard: [gfx-noted])

Attachments

(1 file)

cairo-type1-subset.c uses isxdigit(). This has 2 bugs:

1) On platforms where char is signed, calling isxdigit() with a char argument is UB when the most-significant bit of the char is set.

2) According to MSDN, isxdigit() is locale-sensitive. According to glibc sources, isxdigit() does a lookup from locale-dependent tables, but I didn't check if the that part of the tables actually varies by locale.

Instead of using isxdigit(), Cairo should have a function that does
('0' <= c && c <= '9') || ('A' <= c && c <= 'f') || ('A' <= c && c <= 'F')
(In reply to Henri Sivonen (:hsivonen) from comment #0)
> Instead of using isxdigit(), Cairo should have a function that does
> ('0' <= c && c <= '9') || ('A' <= c && c <= 'f') || ('A' <= c && c <= 'F')

'a' instead of 'A' the first time.
OS: Unspecified → Linux
Priority: -- → P3
Whiteboard: [gfx-noted]
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ae62445f52a2
Cherry-pick cairo commit 30a0ae56d8eaf7735d6f4a8a889e9c54bc0debc1 to fix isxdigit issue. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 92 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: