Skip to content

[BUG]java.lang.ArrayIndexOutOfBoundsException: Index 12288 out of bounds for length 12288 #3209

@yourpleasure

Description

@yourpleasure

问题描述

序列化过程中跑出数组越界问题

环境信息

  • OS信息: Debian 5.4.210.bsk.6 128Core 3.00GHz 512 GB]
  • JDK信息: openjdk 11.0.19
  • 版本信息:fastjson 2.0.0.53

重现步骤

使用jdk8执行无问题,使用jdk11版本执行对特定的数据会出错,具体引起错误的记录还没有找到

期待的正确结果

正常系列化为byte数据,无异常

相关日志输出

java.lang.ArrayIndexOutOfBoundsException: Index 12288 out of bounds for length 12288
at com.alibaba.fastjson2.JSONWriterUTF8.writeStringEscaped(JSONWriterUTF8.java:931)
at com.alibaba.fastjson2.JSONWriterUTF8.writeStringLatin1(JSONWriterUTF8.java:515)
at com.alibaba.fastjson2.JSONWriterUTF8JDK9.writeString(JSONWriterUTF8JDK9.java:22)
at com.alibaba.fastjson2.writer.ObjectWriterImplMap.write(ObjectWriterImplMap.java:494)
at com.alibaba.fastjson2.JSON.toJSONBytes(JSON.java:3238)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixed

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions