-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.1.4
-
Component/s: Aggregation Framework
-
Minor Change
-
ALL
-
Query 2018-03-26
$substrBytes requires two arguments: starting index, and length. Parsing and validation occurs here.
Both are required to be integral, however, we static cast the values to a size_t without checking to ensure they're nonnegative. At the very least, we should give an informative error message if they are negative. It is also conceivable that we want a negative value to mean "return the rest of the string", as in some other operators, in which case we'll need to add special handling.