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

Issue 23754006: Catch potential integer overflows in bigint operations. (Closed)

Created:
7 years, 3 months ago by Michael Lippautz (Google)
Modified:
7 years, 3 months ago
Reviewers:
siva, sra1
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Catch potential integer overflows in bigint operations. strlen() returns a size_t which usually is unsigned long. Since we assign it to intptr_t, we need to check for a potential integer overflow. The (albeit very unlikely) case is lengths>2G on 32bit platforms. BUG= R=asiva@google.com Committed: https://code.google.com/p/dart/source/detail?r=27589

Patch Set 1 #

Patch Set 2 : #

Total comments: 4

Patch Set 3 : addressed comments #

Total comments: 2

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+31 lines, -7 lines) Patch
M runtime/vm/bigint_operations.cc View 1 2 3 4 7 chunks +31 lines, -7 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Michael Lippautz (Google)
7 years, 3 months ago (2013-09-10 19:53:41 UTC) #1
siva
https://codereview.chromium.org/23754006/diff/3001/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): https://codereview.chromium.org/23754006/diff/3001/runtime/vm/bigint_operations.cc#newcode295 runtime/vm/bigint_operations.cc:295: } As discussed offline the overflow could happen before ...
7 years, 3 months ago (2013-09-17 00:19:52 UTC) #2
Michael Lippautz (Google)
Thanks Siva! https://codereview.chromium.org/23754006/diff/3001/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): https://codereview.chromium.org/23754006/diff/3001/runtime/vm/bigint_operations.cc#newcode295 runtime/vm/bigint_operations.cc:295: } On 2013/09/17 00:19:52, siva wrote: > ...
7 years, 3 months ago (2013-09-17 03:36:50 UTC) #3
sra1
dbc https://codereview.chromium.org/23754006/diff/8001/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): https://codereview.chromium.org/23754006/diff/8001/runtime/vm/bigint_operations.cc#newcode111 runtime/vm/bigint_operations.cc:111: if (str_length < 0) { I don't understand ...
7 years, 3 months ago (2013-09-17 05:32:30 UTC) #4
Michael Lippautz (Google)
Thanks! https://codereview.chromium.org/23754006/diff/8001/runtime/vm/bigint_operations.cc File runtime/vm/bigint_operations.cc (right): https://codereview.chromium.org/23754006/diff/8001/runtime/vm/bigint_operations.cc#newcode111 runtime/vm/bigint_operations.cc:111: if (str_length < 0) { On 2013/09/17 05:32:31, ...
7 years, 3 months ago (2013-09-17 17:10:34 UTC) #5
siva
lgtm
7 years, 3 months ago (2013-09-17 17:32:21 UTC) #6
Michael Lippautz (Google)
7 years, 3 months ago (2013-09-18 01:16:14 UTC) #7
Message was sent while issue was closed.
Committed patchset #5 manually as r27589 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698