mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-11 12:10:45 +08:00
添加安全检查,确保转换后的值在int类型的范围内 (#3543)
This commit is contained in:
parent
6d03042e26
commit
625189ce85
1 changed files with 6 additions and 0 deletions
|
|
@ -193,6 +193,12 @@ func getRecycleBinDTOFromName(filename string) (*response.RecycleBinDTO, error)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加安全检查,确保转换后的值在int类型的范围内
|
||||||
|
if size < math.MinInt || size > math.MaxInt {
|
||||||
|
return nil, fmt.Errorf("size out of int range")
|
||||||
|
}
|
||||||
|
|
||||||
deleteTime, err := strconv.ParseInt(matches[3], 10, 64)
|
deleteTime, err := strconv.ParseInt(matches[3], 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue