Skip to content

[BUG]JSON.isValid()方法抛出了异常 #2222

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

Closed
hustliaoyue opened this issue Jan 30, 2024 · 2 comments
Closed

[BUG]JSON.isValid()方法抛出了异常 #2222

hustliaoyue opened this issue Jan 30, 2024 · 2 comments
Assignees
Labels
bug Something isn't working fixed
Milestone

Comments

@hustliaoyue
Copy link

问题描述

简要描述您碰到的问题。

环境信息

请填写以下信息:

  • OS信息: [e.g.:window10]
  • JDK信息: [e.g.:Openjdk 1.8.0_202]
  • 版本信息:[e.g.:Fastjson2 2.0.28]

重现步骤

如何操作可以重现该问题:

  1. 使用 JSON.isValid 方法
  2. 输入 {\"uid\":\"38316683\",\"roleid\":\"61dbb6306123a05f183b1e19\",\"d 数据
  3. 出现 ... 错误
String str = "{\"uid\":\"38316683\",\"roleid\":\"61dbb6306123a05f183b1e19\",\"d";
System.out.println(JSON.isValid(str));

期待的正确结果

对您期望发生的结果进行清晰简洁的描述。
期望方法返回false

相关日志输出

请复制并粘贴任何相关的日志输出。
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 56
at com.alibaba.fastjson2.JSONReaderUTF16.skipName(JSONReaderUTF16.java:2313)
at com.alibaba.fastjson2.JSONReaderUTF16.skipValue(JSONReaderUTF16.java:3855)
at com.alibaba.fastjson2.JSON.isValid(JSON.java:2764)

@hustliaoyue hustliaoyue added the bug Something isn't working label Jan 30, 2024
@hustliaoyue hustliaoyue changed the title [BUG]JSON.isValid()方法存在抛出了异常 [BUG]JSON.isValid()方法抛出了异常 Jan 30, 2024
@yanxutao89 yanxutao89 self-assigned this Jan 30, 2024
@wenshao wenshao added this to the 2.0.47 milestone Feb 1, 2024
@wenshao
Copy link
Member

wenshao commented Feb 1, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.47-SNAPSHOT/
问题已修复,帮忙用2.0.47-SNAPSHOT版本验证,正式版本预计在2月底发布。

@wenshao wenshao added the fixed label Feb 1, 2024
@wenshao
Copy link
Member

wenshao commented Feb 24, 2024

@wenshao wenshao closed this as completed Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

3 participants