[SERVER-68920] Haystack geoSearch accepts NaN for 'limit' and 'maxDistance' Created: 17/Aug/22  Updated: 05/Dec/22  Resolved: 18/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.4.16, 4.2.22
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: David Percy Assignee: Backlog - Query Optimization
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-68309 Investigate for unsafe narrowing conv... Closed
Assigned Teams:
Query Optimization
Operating System: ALL
Participants:

 Description   

The geoSearch command (GeoHaystackSearchCommand) uses the unsafe numberInt() method for the 'limit' and 'maxDistance' arguments. This means passing NaN will have different behavior on different platforms.

limit NaN:

  • x86: effectively no limit.
  • arm: empty results.

maxDistance NaN:

  • x86: empty results.
  • arm: point query.

Ideally the parser should reject this argument since it doesn't make sense.



 Comments   
Comment by Joe Kanaan [ 18/Aug/22 ]

Behavior with NaN is not defined.

Generated at Thu Feb 08 06:12:05 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.