Commit a1758d83 authored by Alexei Zavjalov's avatar Alexei Zavjalov
Browse files

String.IndexOf method handles negative start index value in incorrect way



The standard implementation of String.IndexOf converts the negative value of
the start index to 0 and searching will start from the beginning of the string.
But current implementation may start searching from the incorrect memory
offset, that can lead to sigsegv or return incorrect result.
This patch adds the handler for cases when fromIndex is negative.

Change-Id: I3ac86290712789559eaf5e46bef0006872395bfa
Signed-off-by: default avatarAlexei Zavjalov <alexei.zavjalov@intel.com>
parent b94fae66
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment