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

Issue 729173003: The caseConvert function should not truncate strings with zero length. (Closed)

Created:
6 years, 1 month ago by zherczeg
Modified:
6 years ago
CC:
blink-reviews, blink-reviews-wtf_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

The caseConvert function should not truncate strings with zero length. The truncateAssumingIsolated function is only called for non-empty strings in caseConvert. The type of targetLength is changed to unsigned from signed, which can cause buffer overflows with specially constructed strings. BUG=425478 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=186016

Patch Set 1 #

Patch Set 2 : Second attempt #

Total comments: 1

Patch Set 3 : Remove assert #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
A LayoutTests/fast/html/empty-q-crash.html View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/html/empty-q-crash-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M Source/wtf/text/StringImpl.cpp View 1 2 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 24 (6 generated)
zherczeg
6 years, 1 month ago (2014-11-17 12:26:17 UTC) #1
zherczeg
6 years, 1 month ago (2014-11-18 07:32:01 UTC) #3
zherczeg
6 years, 1 month ago (2014-11-19 09:51:50 UTC) #5
zherczeg
On 2014/11/19 09:51:50, zherczeg wrote: Please review this patch.
6 years, 1 month ago (2014-11-19 09:52:11 UTC) #6
gmorrita
lgtm.
6 years, 1 month ago (2014-11-19 18:10:23 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/729173003/1
6 years, 1 month ago (2014-11-19 18:11:44 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: blink_presubmit on tryserver.blink (http://build.chromium.org/p/tryserver.blink/builders/blink_presubmit/builds/20175)
6 years, 1 month ago (2014-11-19 18:24:03 UTC) #12
tkent
I don't think Patch Set 1 is a right fix. It breaks assumption of truncateAssumingIsolated(). ...
6 years, 1 month ago (2014-11-20 02:34:16 UTC) #13
zherczeg
On 2014/11/20 02:34:16, tkent wrote: > It breaks assumption of > truncateAssumingIsolated(). We should not ...
6 years, 1 month ago (2014-11-20 11:38:51 UTC) #14
zherczeg
> I also noticed however that the type of targetLength is signed (the compiler > ...
6 years, 1 month ago (2014-11-20 11:52:27 UTC) #15
zherczeg
tkent, could you review the new patch?
6 years, 1 month ago (2014-11-24 07:47:43 UTC) #16
tkent
https://codereview.chromium.org/729173003/diff/20001/Source/wtf/text/StringImpl.cpp File Source/wtf/text/StringImpl.cpp (right): https://codereview.chromium.org/729173003/diff/20001/Source/wtf/text/StringImpl.cpp#newcode698 Source/wtf/text/StringImpl.cpp:698: ASSERT(targetLength <= length); This assertion is not correct. input: ...
6 years ago (2014-11-25 00:41:22 UTC) #17
zherczeg
> https://codereview.chromium.org/729173003/diff/20001/Source/wtf/text/StringImpl.cpp#newcode698 > Source/wtf/text/StringImpl.cpp:698: ASSERT(targetLength <= length); > This assertion is not correct. I presume ...
6 years ago (2014-11-25 08:01:47 UTC) #18
tkent
On 2014/11/25 08:01:47, zherczeg wrote: > > > https://codereview.chromium.org/729173003/diff/20001/Source/wtf/text/StringImpl.cpp#newcode698 > > Source/wtf/text/StringImpl.cpp:698: ASSERT(targetLength <= length); ...
6 years ago (2014-11-25 08:20:02 UTC) #19
zherczeg
> No, the ASSERT in truncateAssumingIsolated is different. It's comparing > output->m_length and targetLength. Your ...
6 years ago (2014-11-26 07:57:29 UTC) #20
tkent
lgtm
6 years ago (2014-11-26 07:58:44 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/729173003/40001
6 years ago (2014-11-26 07:59:57 UTC) #23
commit-bot: I haz the power
6 years ago (2014-11-26 09:22:32 UTC) #24
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=186016

Powered by Google App Engine
This is Rietveld 408576698