Fix [JACKSON-842]
diff --git a/release-notes/CREDITS b/release-notes/CREDITS
index 5dffc88..f4e8394 100644
--- a/release-notes/CREDITS
+++ b/release-notes/CREDITS
@@ -924,3 +924,7 @@
Scott Stanton:
* Reported [JACKSON-841] Data is doubled in SegmentedStringWriter output
[1.9.8]
+
+Sébastien R:
+ * Reported [JACKSON-842] ArrayIndexOutOfBoundsException when skipping C-style comments
+ [1.9.8]
diff --git a/release-notes/VERSION b/release-notes/VERSION
index 37881a2..139f654 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -12,7 +12,9 @@
from reported token name
(reported by Lóránt Pintér)
* [JACKSON-841] Data is doubled in SegmentedStringWriter output
- (reported by Scott S)
+ (reported by Scott S)
+ * [JACKSON-842] ArrayIndexOutOfBoundsException when skipping C-style comments
+ (reported by Sebastien R)
------------------------------------------------------------------------
=== History: ===
diff --git a/src/java/org/codehaus/jackson/impl/Utf8StreamParser.java b/src/java/org/codehaus/jackson/impl/Utf8StreamParser.java
index 1c1ee14..981001c 100644
--- a/src/java/org/codehaus/jackson/impl/Utf8StreamParser.java
+++ b/src/java/org/codehaus/jackson/impl/Utf8StreamParser.java
@@ -2432,12 +2432,16 @@
final int[] codes = CharTypes.getInputCodeComment();
// Ok: need the matching '*/'
+ main_loop:
while ((_inputPtr < _inputEnd) || loadMore()) {
int i = (int) _inputBuffer[_inputPtr++] & 0xFF;
int code = codes[i];
if (code != 0) {
switch (code) {
case INT_ASTERISK:
+ if (_inputPtr >= _inputEnd && !loadMore()) {
+ break main_loop;
+ }
if (_inputBuffer[_inputPtr] == INT_SLASH) {
++_inputPtr;
return;