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

Issue 2322903002: Strengthen bounds check in CWeightTable::Calc. (Closed)

Created:
4 years, 3 months ago by Ke Liu
Modified:
4 years, 2 months ago
Reviewers:
Lei Zhang, Oliver Chang
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Strengthen bounds check in CWeightTable::Calc. The buffer PixelWeight.m_Weights was allocated by calling FX_TryAlloc(uint8_t, m_dwWeightTablesSize), but PixelWeight.m_Weights was an int array. Thus bounds check such as |if (idx >= m_dwWeightTablesSize)| in function CWeightTable::Calc() and |idx < m_dwWeightTablesSize ? &pWeight->m_Weights[idx] : nullptr| in function CWeightTable::GetValueFromPixelWeight() were insufficient. This CL strengthens bounds check for accessing int type array PixelWeight.m_Weights. BUG=chromium:619398 R=ochang@chromium.org, thestig@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/5aed0216ad6574944e76a95ef0dbbc910bab4a1a

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add helper method #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -2 lines) Patch
M core/fxge/dib/dib_int.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M core/fxge/dib/fx_dib_engine.cpp View 1 3 chunks +6 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (17 generated)
Ke Liu
4 years, 3 months ago (2016-09-08 07:09:57 UTC) #1
Ke Liu
On 2016/09/08 07:09:57, Ke Liu wrote: Add thestig as a reviewer since he uploaded https://codereview.chromium.org/2204773003/
4 years, 3 months ago (2016-09-08 08:08:54 UTC) #4
Lei Zhang
https://codereview.chromium.org/2322903002/diff/1/core/fxge/dib/fx_dib_engine.cpp File core/fxge/dib/fx_dib_engine.cpp (right): https://codereview.chromium.org/2322903002/diff/1/core/fxge/dib/fx_dib_engine.cpp#newcode66 core/fxge/dib/fx_dib_engine.cpp:66: m_dwWeightTablesSize /= sizeof(int); I think it's weird for a ...
4 years, 3 months ago (2016-09-23 21:32:01 UTC) #5
Ke Liu
On 2016/09/23 21:32:01, Lei Zhang wrote: > https://codereview.chromium.org/2322903002/diff/1/core/fxge/dib/fx_dib_engine.cpp > File core/fxge/dib/fx_dib_engine.cpp (right): > > https://codereview.chromium.org/2322903002/diff/1/core/fxge/dib/fx_dib_engine.cpp#newcode66 ...
4 years, 2 months ago (2016-09-26 08:32:37 UTC) #14
Lei Zhang
lgtm
4 years, 2 months ago (2016-09-26 20:54:34 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2322903002/20001
4 years, 2 months ago (2016-09-26 20:54:41 UTC) #22
commit-bot: I haz the power
4 years, 2 months ago (2016-09-26 20:55:00 UTC) #24
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://pdfium.googlesource.com/pdfium/+/5aed0216ad6574944e76a95ef0dbbc910bab...

Powered by Google App Engine
This is Rietveld 408576698