mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	Fix integer overflows with new parseutil (#15437)
* Use new parseutil helper: Safe variants Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Update parseutil to v0.1.5 Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com> * Fix additional integer overflow in command/server Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
This commit is contained in:
		| @@ -6,6 +6,7 @@ import ( | ||||
| 	"fmt" | ||||
| 	"io" | ||||
| 	"io/ioutil" | ||||
| 	"math" | ||||
| 	"os" | ||||
| 	"path/filepath" | ||||
| 	"strconv" | ||||
| @@ -507,6 +508,9 @@ func ParseConfig(d, source string) (*Config, error) { | ||||
| 		if err != nil { | ||||
| 			return nil, err | ||||
| 		} | ||||
| 		if pluginFilePermissions < math.MinInt || pluginFilePermissions > math.MaxInt { | ||||
| 			return nil, fmt.Errorf("file permission value %v cannot be safely cast to int: exceeds bounds (%v, %v)", pluginFilePermissions, math.MinInt, math.MaxInt) | ||||
| 		} | ||||
| 		result.PluginFilePermissions = int(pluginFilePermissions) | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Scheel
					Alexander Scheel