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

Unified Diff: src/conversions.cc

Issue 2638733002: Fix overflow in Number.prototype.toString with custom radix. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index cf28fb6a10fbed1409c5fe7630458b5084e85873..2d4aaa069237db2545fbc30a1f0e9bbe8831a1ce 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -421,9 +421,10 @@ char* DoubleToRadixCString(double value, int radix) {
// Temporary buffer for the result. We start with the decimal point in the
// middle and write to the left for the integer part and to the right for the
- // fractional part. 1024 characters either way with additional space for sign
- // and decimal point should be sufficient.
- static const int kBufferSize = 2100;
+ // fractional part. 1024 characters for the exponent and 52 for the mantissa
+ // either way, with additional space for sign, decimal point and string
+ // termination should be sufficient.
+ static const int kBufferSize = 2200;
char buffer[kBufferSize];
int integer_cursor = kBufferSize / 2;
int fraction_cursor = integer_cursor;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698