diff options
author | Dan Bornstein <danfuzz@android.com> | 2010-03-05 14:07:41 -0800 |
---|---|---|
committer | Dan Bornstein <danfuzz@android.com> | 2010-03-05 14:07:41 -0800 |
commit | 633bc1a8d332166c7fca3e4f6fa8e5603f1618be (patch) | |
tree | ea64f89607fcced65d982841cae570d1fdeb31b2 /src/org/apache/http | |
parent | 07b7bb333f41e90af0a72a462fed847378641d21 (diff) | |
download | external_apache-http-633bc1a8d332166c7fca3e4f6fa8e5603f1618be.zip external_apache-http-633bc1a8d332166c7fca3e4f6fa8e5603f1618be.tar.gz external_apache-http-633bc1a8d332166c7fca3e4f6fa8e5603f1618be.tar.bz2 |
Fix lineFromReadBuffer() so it no longer tries to skip backwards
past the start of the read buffer.
Fixes internal bug #2183785.
Change-Id: I2a371e88a6816f4c1e237ae4cdb8baade4de66c9
Diffstat (limited to 'src/org/apache/http')
-rw-r--r-- | src/org/apache/http/impl/io/AbstractSessionInputBuffer.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/apache/http/impl/io/AbstractSessionInputBuffer.java b/src/org/apache/http/impl/io/AbstractSessionInputBuffer.java index eb007a9..9ac9b26 100644 --- a/src/org/apache/http/impl/io/AbstractSessionInputBuffer.java +++ b/src/org/apache/http/impl/io/AbstractSessionInputBuffer.java @@ -238,10 +238,14 @@ public abstract class AbstractSessionInputBuffer implements SessionInputBuffer { int off = this.bufferpos; int len; this.bufferpos = pos + 1; - if (pos > 0 && this.buffer[pos - 1] == HTTP.CR) { + // BEGIN android-changed + // The first test below was fixed to not try to skip beyond the + // start of the live part of the buffer. + if (pos > off && this.buffer[pos - 1] == HTTP.CR) { // skip CR if found pos--; } + // END android-changed len = pos - off; if (this.ascii) { charbuffer.append(this.buffer, off, len); |