Skip to content

Commit

Permalink
Merge pull request alibaba#90 from stepinto/master
Browse files Browse the repository at this point in the history
Fix issue alibaba#89
  • Loading branch information
wenshao committed Oct 14, 2013
2 parents 0761e0a + c38c67c commit 78e2651
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2539,7 +2539,7 @@ public final boolean isBlankInput() {

public final void skipWhitespace() {
for (;;) {
if (whitespaceFlags[ch]) {
if (ch < whitespaceFlags.length && whitespaceFlags[ch]) {
next();
continue;
} else {
Expand Down
20 changes: 20 additions & 0 deletions src/test/java/com/alibaba/json/bvt/Bug89.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.alibaba.json.bvt;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import org.junit.Test;

import static org.junit.Assert.fail;

public class Bug89 {
@Test
public void testBug89() {
try {
String s = "{\"a\":з」∠)_,\"}";
JSON.parseObject(s);
fail("Expect JSONException");
} catch (JSONException e) {
// good
}
}
}

0 comments on commit 78e2651

Please sign in to comment.