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

Fixing nil pointer deref on Scrapli send config errors #1723

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

steiler
Copy link
Collaborator

@steiler steiler commented Nov 14, 2023

No description provided.

Comment on lines +288 to +289
if mr != nil {
return fmt.Errorf("failed to apply config; error: %+v %+v", err, mr.Failed)
Copy link
Member

Choose a reason for hiding this comment

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

this one is not needed, as we check for mr != nil above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thats not correct.
its an OR up there ... we could do it in to seperate branches but ... same same

Copy link
Member

Choose a reason for hiding this comment

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

then here it shoudl also be if mr != nil && err != nil
otherwise the statement above might have err == nil, but mr.Failed != nil

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Merging #1723 (82500ca) into main (3b3cbef) will increase coverage by 0.04%.
Report is 2 commits behind head on main.
The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1723      +/-   ##
==========================================
+ Coverage   51.51%   51.56%   +0.04%     
==========================================
  Files         142      143       +1     
  Lines       13776    13805      +29     
==========================================
+ Hits         7097     7118      +21     
- Misses       5891     5896       +5     
- Partials      788      791       +3     
Files Coverage Δ
nodes/vr_sros/vr-sros.go 0.52% <0.00%> (+<0.01%) ⬆️

... and 3 files with indirect coverage changes

@hellt
Copy link
Member

hellt commented Nov 15, 2023

fix verified, thanks @steiler !

@hellt hellt merged commit fab4221 into srl-labs:main Nov 15, 2023
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants