Commit 26e1303
don't segfault given string repeat count larger than 2^31
E.g., this overflows INT_MAX and overruns heap memory:
$ perl -le 'print "v"x(2**31+1)'
[Exit 139 (SEGV)]
(Perl_repeatcpy): Use the same type for "count" as our sole
callers in pp.c: IV (long), not I32 (int). Otherwise, passing
the wider value to a narrower "I32 count"1 parent dd8fc02 commit 26e1303
3 files changed
+6
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1066 | 1066 | | |
1067 | 1067 | | |
1068 | 1068 | | |
1069 | | - | |
| 1069 | + | |
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3244 | 3244 | | |
3245 | 3245 | | |
3246 | 3246 | | |
3247 | | - | |
| 3247 | + | |
3248 | 3248 | | |
3249 | 3249 | | |
3250 | 3250 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3404 | 3404 | | |
3405 | 3405 | | |
3406 | 3406 | | |
3407 | | - | |
| 3407 | + | |
3408 | 3408 | | |
3409 | 3409 | | |
3410 | 3410 | | |
3411 | 3411 | | |
3412 | 3412 | | |
3413 | 3413 | | |
3414 | 3414 | | |
3415 | | - | |
| 3415 | + | |
3416 | 3416 | | |
3417 | 3417 | | |
3418 | 3418 | | |
3419 | 3419 | | |
3420 | | - | |
| 3420 | + | |
3421 | 3421 | | |
3422 | 3422 | | |
3423 | 3423 | | |
3424 | 3424 | | |
3425 | 3425 | | |
3426 | 3426 | | |
3427 | | - | |
| 3427 | + | |
3428 | 3428 | | |
3429 | 3429 | | |
3430 | 3430 | | |
| |||
0 commit comments