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

Unified Diff: third_party/harfbuzz/src/harfbuzz-shaper.cpp

Issue 7465036: OOB read in harfbuzz with khmer character. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 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
« no previous file with comments | « third_party/harfbuzz/chromium.patch ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz/src/harfbuzz-shaper.cpp
diff --git a/third_party/harfbuzz/src/harfbuzz-shaper.cpp b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
index f1606e6a79813f5214248f76da56f2050b08d60b..2a91b076bb3d949cff466b2fc15ad108505bd50d 100644
--- a/third_party/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/third_party/harfbuzz/src/harfbuzz-shaper.cpp
@@ -1150,10 +1150,11 @@ HB_Bool HB_OpenTypeShape(HB_ShaperItem *item, const hb_uint32 *properties)
return false;
face->tmpLogClusters = tmpLogClusters;
+ const int itemLength = item->item.length;
for (int i = 0; i < face->length; ++i) {
hb_buffer_add_glyph(face->buffer, item->glyphs[i], properties ? properties[i] : 0, i);
face->tmpAttributes[i] = item->attributes[i];
- face->tmpLogClusters[i] = item->log_clusters[i];
+ face->tmpLogClusters[i] = i < itemLength ? item->log_clusters[i] : item->log_clusters[itemLength - 1];
agl 2011/07/26 14:21:38 What happens if |itemLength| is zero? Is this impo
bashi 2011/07/27 03:24:01 I think |itemLength| is always greater than zero.
}
#ifdef OT_DEBUG
« no previous file with comments | « third_party/harfbuzz/chromium.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698