Skip to content

Commit 82fb894

Browse files
authored
Merge pull request #138 from Icinga:fix/byte_conersion_overflow
Bugfix: Fixing value overflow on Convert-Bytes Cmdlet Fixes an issue while converting data size values from any other datatype to bytes which will cause an overflow and might result in issues during comparison.
2 parents 84e6ff3 + 4bc03b6 commit 82fb894

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

doc/31-Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
2222
* [#127](https://github.com/Icinga/icinga-powershell-framework/issues/127) Fixes wrong error message on failed MSSQL connection due to database not reachable by using `-IntegratedSecurity`
2323
* [#128](https://github.com/Icinga/icinga-powershell-framework/issues/128) Fixes unhandled output from loading `System.Reflection.Assembly` which can cause weird side effects for plugin outputs
2424
* [#130](https://github.com/Icinga/icinga-powershell-framework/issues/130) Fix crash while running services as background task to collect metrics over time by missing Performance Counter cache initialisation
25+
* [#138](https://github.com/Icinga/icinga-powershell-framework/issues/138) Fixes possible value overflow on `Convert-Bytes` while converting from anything larger than MB to Bytes
2526

2627
## 1.2.0 (2020-08-28)
2728

lib/core/tools/Convert-Bytes.psm1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function Convert-Bytes()
3333
}
3434
}
3535
}
36-
return @{'value' = $FinalValue; 'pastunit' = $CurrentUnit; 'endunit' = $Unit };
36+
return @{'value' = ([decimal]$FinalValue); 'pastunit' = $CurrentUnit; 'endunit' = $Unit };
3737
}
3838

3939
Exit-IcingaThrowException -ExceptionType 'Input' -ExceptionThrown $IcingaExceptions.Inputs.ConversionUnitMissing -Force;

0 commit comments

Comments
 (0)