freetype2/src
Ben Wagner 09b326fa2b Avoid strtol on non-null-terminated data.
Technically, `strtol` can only be used with C strings terminated with
`\0`.  CID data is not generally null-terminated and often does not
contain a `\0` if it is hex-encoded.  AddressSanitizer with `ASAN_OPTIONS`
containing `strict_string_checks=1` verifies this by using an adversarial
`strtol` that always reads to the terminating `\0`.

To avoid undefined behavior from `strtol` in `cid_parser_new`, use the
parser to parse the tokens instead of attempting to parse them ad-hoc.
This will internally use `PS_Conv_Strtol` to parse the integer, which
respects the parser's limits and directly implements the PostScript
parsing rules for integers.

* src/cid/cidparse.c (cid_parser_new): Use the parser to parse the
tokens.

Fixes: https://bugs.chromium.org/p/chromium/issues/detail?id=1420329
2023-03-02 20:56:41 +01:00
..
autofit * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
base * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
bdf Avoid reserved identifiers that are globally defined. 2023-02-08 21:09:30 +01:00
bzip2 Update all copyright notices. 2023-01-17 09:18:25 +01:00
cache Update all copyright notices. 2023-01-17 09:18:25 +01:00
cff * src/cff/cffload.c (cff_subfont_load): Synonymous update. 2023-03-02 17:58:03 +00:00
cid Avoid strtol on non-null-terminated data. 2023-03-02 20:56:41 +01:00
dlg * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
gxvalid Update all copyright notices. 2023-01-17 09:18:25 +01:00
gzip * src/gzip/README.freetype: Update version. 2023-03-01 18:20:46 +00:00
lzw Fix 'fall-through' warning messages. 2023-02-08 21:09:32 +01:00
otvalid Update all copyright notices. 2023-01-17 09:18:25 +01:00
pcf Whitespace. 2023-01-28 17:04:11 +01:00
pfr Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags. 2023-02-08 21:09:32 +01:00
psaux * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
pshinter Fix `FT_LOCAL` and `FT_LOCAL_DEF` tags. 2023-02-08 21:09:32 +01:00
psnames Update all copyright notices. 2023-01-17 09:18:25 +01:00
raster [raster] Clean up contour indexing. 2023-02-21 16:17:07 +00:00
sdf * src/sdf/ftsdf.c (get_min_distance_cubic): Fix C4701, typos. 2023-02-20 22:29:18 -05:00
sfnt * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
smooth [base] Clean up contour indexing. 2023-02-20 16:33:45 +00:00
svg Update all copyright notices. 2023-01-17 09:18:25 +01:00
tools * src/tools/update-copyright: Allow execution from other repositories. 2023-01-17 19:03:45 +01:00
truetype [truetype] Treat 38 as 40 without Infinality. 2023-02-27 21:54:23 -05:00
type1 * src/*: Replace leading underscores with trailing ones in dummy variables. 2023-02-26 20:18:54 +01:00
type42 Fix 'fall-through' warning messages. 2023-02-08 21:09:32 +01:00
winfonts Update all copyright notices. 2023-01-17 09:18:25 +01:00