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_: properly check type casts in activity service #6279

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

dlipicar
Copy link
Contributor

Closes https://github.com/status-im/least-authority-audit/issues/17

Properly check type cast validity before attempting to access it.

@dlipicar dlipicar requested a review from a team January 23, 2025 14:49
Comment on lines +328 to +332
} else if err == nil {
recipientsResponse, ok := result.(*GetRecipientsResponse)
if ok {
res = recipientsResponse
}
Copy link
Member

Choose a reason for hiding this comment

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

If err == nil and result can not be type asserted as * GetRecipientsResponse then this function will return :

&GetRecipientsResponse{
			ErrorCode: ErrorCodeFailed,
		}

Copy link
Contributor Author

@dlipicar dlipicar Jan 23, 2025

Choose a reason for hiding this comment

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

that's fine, it's basically the same behavior you get from the other functions, since for some reason you don't have a valid result you can return.

Copy link
Collaborator

@igor-sirotin igor-sirotin left a comment

Choose a reason for hiding this comment

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

@dlipicar is there a linter we can apply to prevent this in the future?

@status-im-auto
Copy link
Member

status-im-auto commented Jan 23, 2025

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c963ccf #1 2025-01-23 18:27:05 ~5 min ios 📦zip
✔️ c963ccf #1 2025-01-23 18:59:28 ~6 min android 📦aar
✖️ c963ccf #1 2025-01-23 21:33:05 ~31 min tests 📄log
✖️ c963ccf #2 2025-01-23 22:36:54 ~29 min tests 📄log
✖️ c963ccf #1 2025-01-23 23:20:53 ~6 min tests-rpc 📄log

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.

4 participants