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

CBORGenerator.writeRawUTF8String() seems to ignore offset #366

Closed
nik9000 opened this issue Mar 9, 2023 · 2 comments
Closed

CBORGenerator.writeRawUTF8String() seems to ignore offset #366

nik9000 opened this issue Mar 9, 2023 · 2 comments
Labels
Milestone

Comments

@nik9000
Copy link

nik9000 commented Mar 9, 2023

I've encountered an issue when working with cbor where it looks like the writeRawUtf8String is ignoring the offset. I'm no expert, but it looks like this:

still ignores the offset parameter.

In my version the method's source is:

    @Override
    public void writeRawUTF8String(byte[] raw, int offset, int len)
            throws IOException
    {
        _verifyValueWrite("write String value");
        if (len == 0) {
            _writeByte(BYTE_EMPTY_STRING);
            return;
        }
        _writeLengthMarker(PREFIX_TYPE_TEXT, len);
        _writeBytes(raw, 0, len);
    }

And it certainly isn't touching the offset parameter. I need that one!

@cowtowncoder
Copy link
Member

@nik9000 That definitely looks like a straight bug. Thank you for reporting this!

@cowtowncoder cowtowncoder modified the milestones: 2.14.0, 2.14.3 Mar 10, 2023
@cowtowncoder cowtowncoder changed the title CBOR writeRawUTF8String seems to ignore offset CBORGenerator.writeRawUTF8String() seems to ignore offset Mar 10, 2023
@cowtowncoder
Copy link
Member

Thank you for reporting this @nik9000 -- amazing this bug has been there all along :-/

Fix will be included in 2.14.3 / 2.15.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants