diff options
author | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-10-15 16:55:52 +0000 |
---|---|---|
committer | clemenso <clemenso@8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4> | 2009-10-15 16:55:52 +0000 |
commit | dbac8211c342c8830baf0a48424b2769d4ec63af (patch) | |
tree | 28e338ab09484c9bdb187aacddfcafd9ca8547cf /bkucommon/src/main/java/at/gv/egiz | |
parent | 25cbc5fbcf4016c5b7bfaa38b6ae1354ea43120c (diff) | |
download | mocca-dbac8211c342c8830baf0a48424b2769d4ec63af.tar.gz mocca-dbac8211c342c8830baf0a48424b2769d4ec63af.tar.bz2 mocca-dbac8211c342c8830baf0a48424b2769d4ec63af.zip |
reset pos on buf reread
(indexoutofboundsEx 4096)
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@524 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
Diffstat (limited to 'bkucommon/src/main/java/at/gv/egiz')
-rw-r--r-- | bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java index f052ce05..f60b42b3 100644 --- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java +++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/XWWWFormUrlInputIterator.java @@ -312,12 +312,18 @@ public class XWWWFormUrlInputIterator implements Iterator<FormParameter> { } else if (buf[pos] == '+') { b[off] = ' '; } else if (buf[pos] == '%') { - if (++pos == count && (count = in.read(buf)) == -1) { - throw new IOException("Invalid URL encoding."); + if (++pos == count) { + if ((count = in.read(buf)) == -1) { + throw new IOException("Invalid URL encoding."); + } + pos = 0; } int c1 = Character.digit(buf[pos], 16); - if (++pos == count && (count = in.read(buf)) == -1) { - throw new IOException("Invalid URL encoding."); + if (++pos == count) { + if ((count = in.read(buf)) == -1) { + throw new IOException("Invalid URL encoding."); + } + pos = 0; } int c2 = Character.digit(buf[pos], 16); b[off] = (byte) ((c1 << 4) | c2); |