Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: pdf/pdfium/pdfium_page.cc

Issue 2650513002: Fix buffer overrun in PDF accessibility code. (Closed)
Patch Set: Depend on pdf_private Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pdf/pdfium/pdfium_page.cc
diff --git a/pdf/pdfium/pdfium_page.cc b/pdf/pdfium/pdfium_page.cc
index 39db69ec51173d5d9089524cb0f7f931f64b44eb..e8070f2a13421fbd893f59fcbc0e16b4ec50a7b4 100644
--- a/pdf/pdfium/pdfium_page.cc
+++ b/pdf/pdfium/pdfium_page.cc
@@ -180,7 +180,8 @@ void PDFiumPage::GetTextRunInfo(int start_char_index,
int text_run_font_size = FPDFText_GetFontSize(text_page, char_index);
pp::FloatRect text_run_bounds =
GetFloatCharRectInPixels(page, text_page, char_index);
- char_index++;
+ if (char_index < chars_count)
+ char_index++;
while (char_index < chars_count) {
unsigned int character = FPDFText_GetUnicode(text_page, char_index);
« chrome/browser/pdf/pdf_extension_test.cc ('K') | « chrome/browser/pdf/pdf_extension_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698