Closed Bug 1486385 Opened 7 years ago Closed 2 years ago

SkPDFConvertType1FontStream.cpp uses isxdigit()

Categories

(Core :: Graphics, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: hsivonen, Unassigned)

References

Details

(Whiteboard: [gfx-noted])

SkPDFConvertType1FontStream.cpp 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(), Skia 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) > ('0' <= c && c <= '9') || ('A' <= c && c <= 'f') || ('A' <= c && c <= 'F') 'a' instead of 'A' the first time.
Lee, I assume this will be picked up by a future skia update?
Priority: -- → P3
Whiteboard: [gfx-noted]
Severity: normal → S3

This bug has been patched in upstream and merged here. This bug should be closed.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.