-
Notifications
You must be signed in to change notification settings - Fork 22
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
Fixed GAUGE32 integer overflow in base_client.rb #65
Conversation
I changed the dist to trusty, only way i found to get it building with oraclejdk8 again. |
Thanks a lot @pprugger !
|
FYI build fixed in #66 |
I hope it's not too much of chaos now, had some problems with rebaseing. |
@pprugger thanks for the dist revert. I'll send an example spec which will fail locally for me without patch and works for you, you can then include it in your PR! |
@pprugger here, you can add these 2 tests in `spec/inputs/snmp/base_client_spec.rb" in the "coercion" context:
The first one for GAUGE32 does not pass for me and returns -1 as you noted and should pass for you, the second for INTEGER32 does pass which is normal; I just added it for the sake of completeness. |
Did you change something else? It seems the names Gauge32 and Integer32 are not known in my context. |
I added the java imports. Works now and can be merged if you want. |
spec/inputs/snmp/base_client_spec.rb
Outdated
@@ -32,6 +34,18 @@ def coerce(*args) | |||
v = AbstractVariable.create_from_syntax(SMIConstants::EXCEPTION_END_OF_MIB_VIEW ) | |||
expect(subject).to receive(:logger).exactly(1).times.and_call_original | |||
expect(subject.coerce(v)).to eq("error: unknown variable syntax 130, EndOfMibView") | |||
end | |||
|
|||
it "should handle max unsigned 32 bits integer GAUGE32" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmetic: the identation is off
@pprugger great stuff!! yeah, forgot to mention the java imports but you figured it out 👍 |
Co-Authored-By: Colin Surprenant <colin.surprenant@gmail.com>
Fixed! Will you do a new release after the merge? |
Thanks a lot again for your contribution @pprugger. Feel free to submit a PR to add your information into the |
v1.2.1 published. |
As discussed here:
#64
Best regards