Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of UTF-16 in ID3 frames #1774

Closed
cbfiddle opened this issue Aug 24, 2016 · 1 comment
Closed

Incorrect parsing of UTF-16 in ID3 frames #1774

cbfiddle opened this issue Aug 24, 2016 · 1 comment
Labels

Comments

@cbfiddle
Copy link
Contributor

The end of string detection (introduced for issue 324) looks for a pair of zero bytes. It should look for a pair of zero bytes starting at an even index, otherwise it will incorrectly parse a string whose last character encoding ends with a 0 byte.

Suggested change to Id3Parser.indexOfEos:

    // Otherwise ensure an even index and look for a second zero byte.
    while (terminationPos < data.length - 1) {
      if (terminationPos % 2 == 0 && data[terminationPos + 1] == (byte) 0) {
        return terminationPos;
      }
      terminationPos = indexOfZeroByte(data, terminationPos + 1);
    }

@ojw28 ojw28 added the bug label Aug 24, 2016
@ojw28
Copy link
Contributor

ojw28 commented Aug 25, 2016

Thanks for reporting this; we'll push a fix to V1 and V2 shortly.

ojw28 added a commit that referenced this issue Aug 31, 2016
Issue: #1774

-------------
Created by MOE: https:/google/moe
MOE_MIGRATED_REVID=131389528
ojw28 added a commit that referenced this issue Aug 31, 2016
Issue: #1774

-------------
Created by MOE: https:/google/moe
MOE_MIGRATED_REVID=131389528
@ojw28 ojw28 closed this as completed Aug 31, 2016
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants