-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
-
QE 2024-09-16
-
200
substr_utils::getSubstringCP() returns an empty StringData when the start index is greater than the input data which initialises an empty string_view. This will later end up as a nullptr in a memcpy call. We can instead return ""_sd which would correctly be interpreted as a string with 0 characters. For additional safety we could also add an invariant that the second argument of memcpy is not a null pointer.
- related to
-
SERVER-51557 Support expression $substrCP in SBE
- Closed