Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: check index before assignment #10299

Merged
merged 2 commits into from
Dec 20, 2021
Merged

fix: check index before assignment #10299

merged 2 commits into from
Dec 20, 2021

Conversation

MyaLongmire
Copy link
Contributor

@MyaLongmire MyaLongmire commented Dec 17, 2021

Required for all PRs:

resolves #10298

Check the index before looking it up in case there is a floating :: eg. RFC1213-MIB:: instead of RFC1213-MIB::sysUpTime, also added unit test. This will now error instead of panic

@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Dec 17, 2021
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @MyaLongmire, thanks for looking into this! One small comment and a question regarding using SplitN instead of Split...

internal/snmp/translate.go Outdated Show resolved Hide resolved
@srebhan srebhan self-assigned this Dec 20, 2021
Copy link
Contributor

@srebhan srebhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect to me. Thanks @MyaLongmire!!!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Dec 20, 2021
@srebhan srebhan requested a review from Hipska December 20, 2021 17:35
internal/snmp/translate.go Show resolved Hide resolved
@MyaLongmire MyaLongmire merged commit 973ffba into master Dec 20, 2021
@MyaLongmire MyaLongmire deleted the snmp-parsing branch December 20, 2021 17:52
powersj pushed a commit that referenced this pull request Jan 5, 2022
nward added a commit to nward/telegraf that referenced this pull request Jan 12, 2022
powersj pushed a commit to powersj/telegraf that referenced this pull request Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/snmp fix pr to fix corresponding bug ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Telegraf 1.21.0 - go panic with SNMP plugin
4 participants