mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-31 22:07:25 -08:00
fix(color): validate number range
This commit is contained in:
parent
20462aa50f
commit
a86ab4f525
|
@ -81,7 +81,7 @@ func (d *DefaultColors) AnsiColorFromString(colorString string, isBackground boo
|
|||
}
|
||||
if !strings.HasPrefix(colorString, "#") {
|
||||
val, err := strconv.ParseUint(colorString, 10, 64)
|
||||
if err != nil {
|
||||
if err != nil || val > 255 {
|
||||
return emptyAnsiColor
|
||||
}
|
||||
c256 := color.C256(uint8(val), isBackground)
|
||||
|
|
Loading…
Reference in a new issue