| commit | 3a4922a8bff5719beeb731a39878047e258245d1 | [log] [tgz] |
|---|---|---|
| author | Tiago Vignatti <tvignatti@igalia.com> | Mon Sep 29 16:47:21 2025 |
| committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Sep 29 16:47:21 2025 |
| tree | ec50427daa859d621c783bc5521a211e6adf3a96 | |
| parent | efa8ace1e8cbe6471a7e11a60e1f079c1a6e6711 [diff] |
Fix signed-to-unsigned conversion bug in PDF text processing
This commit fixes a bug in PDFiumPage where char count of -1 was
incorrectly converted to 4294967295 instead of 0.
A clusterfuzz testcase exposed this vulnerability through a unique PDF
object corruption:
/ProcSet [/PDF/Text/ImageC/Image/Image/Image/Image/Image/Image...
→ thousands of repeated /Image entries
which would lead to a crash:
1. FPDFText_LoadPage() fails when parsing malformed structures, returns nullptr
2. FPDFText_CountChars(nullptr), returns -1
3. CalculateTextRuns() converts -1 to uint32_t, becomes 4294967295
(not 0 as stated in the comment!)
4. GetTextRunInfoAt() returns empty optional for invalid indices
5. Calling .value() on empty optional, crash
Bug: 447520186
Change-Id: Ide75829d73002c32b3e6d360ce6183a62c75d7b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6995201
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1522295}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.