summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Villar Senin <svillar@igalia.com>2010-12-13 10:31:22 +0100
committerSergio Villar Senin <svillar@igalia.com>2010-12-13 10:35:11 +0100
commitc5ece4947054deadfbc5aad247d33375df56ed0e (patch)
tree38cc5d71e1ea36148386885c594a9738c67981b1
parentd3c751a0d2dc573a69baa5eee3dd6376593c5b2a (diff)
downloadlibsoup-c5ece4947054deadfbc5aad247d33375df56ed0e.tar.gz
soup-http-input-stream: fixed a condition
priv->caller_buffsize and priv->leftover_bufsize are both unsigned integers, and thus, checking (a - b > 0) could incorrectly return TRUE if b > a.
-rw-r--r--libsoup/soup-http-input-stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libsoup/soup-http-input-stream.c b/libsoup/soup-http-input-stream.c
index cee978fb..26871337 100644
--- a/libsoup/soup-http-input-stream.c
+++ b/libsoup/soup-http-input-stream.c
@@ -266,7 +266,7 @@ soup_http_input_stream_got_chunk (SoupMessage *msg, SoupBuffer *chunk_buffer,
g_warning ("soup_http_input_stream_got_chunk called again before previous chunk was processed");
/* Copy what we can into priv->caller_buffer */
- if (priv->caller_bufsize - priv->caller_nread > 0) {
+ if (priv->caller_bufsize > priv->caller_nread) {
gsize nread = MIN (chunk_size, priv->caller_bufsize - priv->caller_nread);
memcpy (priv->caller_buffer + priv->caller_nread, chunk, nread);