new mode "output-banks" for plugin APC-ATS#6206
Open
rmorandell-pgum wants to merge 4 commits into
Open
Conversation
| } | ||
| } | ||
|
|
||
| if (!defined($self->{global}) && scalar(keys %{$self->{bank}}) <= 0) { |
There was a problem hiding this comment.
The check uses keys %{$self->{bank}} even when $self->{bank} may be undefined, which can crash instead of reaching the "No banks matching" path.
Suggested change
| if (!defined($self->{global}) && scalar(keys %{$self->{bank}}) <= 0) { | |
| if (!defined($self->{global}) && (!defined($self->{bank}) || scalar(keys %{$self->{bank}}) <= 0)) { |
Details
✨ AI Reasoning
The final emptiness check assumes two containers may both be empty, but one of them is not initialized before being dereferenced. If no per-bank entry is stored during selection and the overall entry is also missing, evaluating the hash key count on an undefined reference can fail before the intended "No banks matching" message is emitted.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Community contributors
Description
APC-ATS has output banks
The new mode checks the total/overall status and perf data and the single bank data.
Type of change
How this pull request can be tested ?
powernet441.mib.txt
atsOutputBankTable -> atsOutputBankEntry
Here is the walk:
ats.snmpwalk.txt
Checklist