mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-14 06:06:41 +00:00
Merge pull request #11351 from revam/fix-off-by-one-error-in-get-attribute-value
fix: fix off-by-one error in `GetAttributeValue`
This commit is contained in:
@@ -31,8 +31,9 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
var attributeIndex = str.IndexOf(attribute, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// Must be at least 3 characters after the attribute =, ], any character.
|
||||
var maxIndex = str.Length - attribute.Length - 3;
|
||||
// Must be at least 3 characters after the attribute =, ], any character,
|
||||
// then we offset it by 1, because we want the index and not length.
|
||||
var maxIndex = str.Length - attribute.Length - 2;
|
||||
while (attributeIndex > -1 && attributeIndex < maxIndex)
|
||||
{
|
||||
var attributeEnd = attributeIndex + attribute.Length;
|
||||
|
||||
Reference in New Issue
Block a user