Bug fixes:

* make sure we never have an invalid startIndex in PwGroup.SearchEvalAdd
 * make sure AndroidContentStorage does never throw (not if permission denial exception occurs) and make sure we always return a reason for read-only. Also don't return read-only when it's not.
 * StopListening doesn't log Invalid State Exception as unexpected
This commit is contained in:
Philipp Crocoll
2016-01-18 21:18:22 +01:00
parent 311316ea50
commit aaa6b371e0
5 changed files with 38 additions and 19 deletions

View File

@@ -990,7 +990,7 @@ namespace KeePassLib
if (contextString.Length > SearchContextStringMaxLength)
{
// Start 10% before actual data, and don't run over
var startPos = Math.Min(matchPos - (SearchContextStringMaxLength / 10), contextString.Length - SearchContextStringMaxLength);
var startPos = Math.Max(0, Math.Min(matchPos - (SearchContextStringMaxLength / 10), contextString.Length - SearchContextStringMaxLength));
contextString = "<22> " + contextString.Substring(startPos, SearchContextStringMaxLength) + ((startPos + SearchContextStringMaxLength < contextString.Length) ? " <20>" : null);
}
resultContexts[pe.Uuid] = new KeyValuePair<string, string>(contextFieldName, contextString);