Skip to content

Eagerly return null values in AbstractOperations.deserializeGeoResults(…) to avoid null dereference #2280

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

Closed
wants to merge 1 commit into from

Conversation

yarooh
Copy link

@yarooh yarooh commented Mar 14, 2022

In LettuceConnection pipeline mode, using DefaultGeoOperations to call geo-related methods will get null, then convert the return value by calling method deserializeGeoResults will throw NPE.
To avoid NPE,check if the source is null before deserializeGeoResults conversion.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

In LettuceConnection pipeline mode, using DefaultGeoOperations to call
geo-related methods will get null, then convert the return value by
calling method deserializeGeoResults will throw NPE.
To avoid NPE,
check if the source is null before deserializeGeoResults conversion.
@pivotal-cla
Copy link

@yarooh Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 14, 2022
@pivotal-cla
Copy link

@yarooh Thank you for signing the Contributor License Agreement!

@yarooh yarooh changed the title fix: fix:issue/2279 Mar 14, 2022
@christophstrobl christophstrobl added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 28, 2022
@christophstrobl christophstrobl requested a review from mp911de March 28, 2022 14:23
@mp911de mp911de changed the title fix:issue/2279 Eagerly return null values in AbstractOperations.deserializeGeoResults(…) to avoid null dereference Mar 31, 2022
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@mp911de
Copy link
Member

mp911de commented Mar 31, 2022

Thank you for your contribution. That's merged, polished, and backported now.

mp911de pushed a commit that referenced this pull request Mar 31, 2022
…ults(…)` to avoid null dereference.

Closes #2279
Original pull request: #2280.
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@mp911de mp911de closed this Mar 31, 2022
@mp911de mp911de added this to the 2.5.11 (2021.0.11) milestone Mar 31, 2022
mp911de added a commit that referenced this pull request Mar 31, 2022
Add nullable annotations. Add tests.

See #2279
Original pull request: #2280.
@yarooh yarooh deleted the issue/2279 branch April 1, 2022 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultGeoOperations.radius(…) throws NullPointerException in pipeline mode
5 participants