File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -853,6 +853,12 @@ extern void *MALLOC(size_t);
853
853
#define MALLOC malloc
854
854
#endif
855
855
856
+ #ifdef FREE
857
+ extern void FREE (void * );
858
+ #else
859
+ #define FREE free
860
+ #endif
861
+
856
862
#ifndef Omit_Private_Memory
857
863
#ifndef PRIVATE_MEM
858
864
#define PRIVATE_MEM 2304
@@ -1142,7 +1148,7 @@ Balloc(int k)
1142
1148
#endif
1143
1149
1144
1150
ACQUIRE_DTOA_LOCK (0 );
1145
- if ((rv = freelist [k ]) != 0 ) {
1151
+ if (k <= Kmax && (rv = freelist [k ]) != 0 ) {
1146
1152
freelist [k ] = rv -> next ;
1147
1153
}
1148
1154
else {
@@ -1171,6 +1177,10 @@ static void
1171
1177
Bfree (Bigint * v )
1172
1178
{
1173
1179
if (v ) {
1180
+ if (v -> k > Kmax ) {
1181
+ FREE (v );
1182
+ return ;
1183
+ }
1174
1184
ACQUIRE_DTOA_LOCK (0 );
1175
1185
v -> next = freelist [v -> k ];
1176
1186
freelist [v -> k ] = v ;
@@ -2231,6 +2241,7 @@ ruby_strtod(const char *s00, char **se)
2231
2241
for (; c >= '0' && c <= '9' ; c = * ++ s ) {
2232
2242
have_dig :
2233
2243
nz ++ ;
2244
+ if (nf > DBL_DIG * 2 ) continue ;
2234
2245
if (c -= '0' ) {
2235
2246
nf += nz ;
2236
2247
for (i = 1 ; i < nz ; i ++ )
You can’t perform that action at this time.
0 commit comments