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

core: add nil checks #2090

Merged
merged 3 commits into from
Apr 12, 2023
Merged

core: add nil checks #2090

merged 3 commits into from
Apr 12, 2023

Conversation

dB2510
Copy link
Contributor

@dB2510 dB2510 commented Apr 12, 2023

Adds nil checks before reading proto messages in core package mentioned in audit report.

Refer: OBOL-03

category: misc
ticket: #1997

@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: -0.05 ⚠️

Comparison is base (0dd410d) 53.63% compared to head (620bf60) 53.58%.

❗ Current head 620bf60 differs from pull request most recent head 2fca490. Consider uploading reports for the commit 2fca490 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2090      +/-   ##
==========================================
- Coverage   53.63%   53.58%   -0.05%     
==========================================
  Files         174      174              
  Lines       22671    22715      +44     
==========================================
+ Hits        12159    12172      +13     
- Misses       9004     9026      +22     
- Partials     1508     1517       +9     
Impacted Files Coverage Δ
core/parsigex/parsigex.go 62.79% <0.00%> (-2.27%) ⬇️
core/priority/component.go 0.00% <0.00%> (ø)
core/proto.go 64.10% <100.00%> (+2.19%) ⬆️

... and 7 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

core/proto.go Show resolved Hide resolved
@dB2510
Copy link
Contributor Author

dB2510 commented Apr 12, 2023

@corverroos
A short note: The audit report also mentioned to add check in core/proto.go::DutyFromProto(). I didn't added that as we already do nil checks before passing duty proto to this function wherever it is called. Also adding check to this will modify function signature to return error which impacts uses of this function some other places as well. Not worth it IMO. WDYT?

core/proto.go Outdated Show resolved Hide resolved
@dB2510 dB2510 linked an issue Apr 12, 2023 that may be closed by this pull request
@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label Apr 12, 2023
@obol-bulldozer obol-bulldozer bot merged commit f0f663e into main Apr 12, 2023
@obol-bulldozer obol-bulldozer bot deleted the dhruv/corenilchecks branch April 12, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nil Pointer References from Protobuf Messages.
2 participants