[SERVER-53116] Coverity analysis defect 116684: Improper use of negative value Created: 30/Nov/20  Updated: 27/Oct/23  Resolved: 15/Dec/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Coverity Collector User Assignee: Milena Ivanova
Resolution: Works as Designed Votes: 0
Labels: coverity
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Sprint: Query 2020-12-14, Query 2020-12-28
Participants:

 Description   

Improper use of negative value

The negative value may be unexpected by later operations, causing incorrect computations. Negative value can be returned from function is not being checked before being used improperly
/src/mongo/db/exec/sbe/vm/vm.cpp:2075: NEGATIVE_RETURNS 116684 Assigning: "numCaptures" = "pcre->getNumberCaptures()".



 Comments   
Comment by Asya Kamsky [ 01/Dec/20 ]

This looks like a false positive on Coverity side - it's missing meaning of invariant inside the function that it flags as returning a negative number.

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