Commit 162b23a
aleruggeri87
Cap bufsiz variable (long) to avoid overflow in Alphabit & Rabbit
With nb > 2^(31+5), bufsiz is not correctly computed (can lead to a negative value); furthermore, with nb > 2^(31-2), util_Min() in ufile_CreateReadBin() could miscalculate the minimum value and the following util_Calloc() returns an error. To avoid all of this, bufsiz has been limited to LONG_MAX/4 (in any case, the maximum allocated buffer will be ARRAYDIM << LONG_MAX/4).1 parent 9f83fe2 commit 162b23a
1 file changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2751 | 2751 | | |
2752 | 2752 | | |
2753 | 2753 | | |
2754 | | - | |
| 2754 | + | |
| 2755 | + | |
| 2756 | + | |
| 2757 | + | |
| 2758 | + | |
2755 | 2759 | | |
2756 | 2760 | | |
2757 | 2761 | | |
| |||
3300 | 3304 | | |
3301 | 3305 | | |
3302 | 3306 | | |
3303 | | - | |
| 3307 | + | |
| 3308 | + | |
| 3309 | + | |
| 3310 | + | |
| 3311 | + | |
3304 | 3312 | | |
3305 | 3313 | | |
3306 | 3314 | | |
| |||
0 commit comments