Integer overflow in command argument set_if
Open
@sourav25998 is already working on this.
Since Sep 12, 2022.
area/checks
area/configuration
bug
good first issue
- Dominant language
- C++
- Stars
- 2.2k
- Forks
- 616
- Avg merge
- 5d 6h
- Merged PRs (30d)
- 10
Description
Config snippet:
object CheckCommand "set-if-overflow" {
command = ["echo"]
arguments = {
"42" = {
set_if = 42
}
"4294967296" = {
set_if = 4294967296
}
}
}
object Host "set-if-overflow" {
check_command = "set-if-overflow"
}
Executed the following command:
"last_check_result": {
"active": true,
"check_source": "master-2",
"command": [
"echo",
"42"
],
Using both numbers shouldn't make a difference, however it's casted to int here, which overflows with the value above:
https://github.com/Icinga/icinga2/blob/32c7f7730db154ba0dff5856a8985d125791c73e/lib/icinga/macroprocessor.cpp#L480-L488
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.