summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-20 23:38:57 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-20 23:38:57 +0000
commit304bdfdc6b0840b1eca28fd248e305524273515e (patch)
treeceba59e790054e9d1461854a6865ca22ba9ae046 /src
parent8b8d38162b1720467a42e043383b91f7100faf64 (diff)
downloadtor-304bdfdc6b0840b1eca28fd248e305524273515e.tar.gz
tor-304bdfdc6b0840b1eca28fd248e305524273515e.zip
r18279@catbus: nickm | 2008-02-20 18:38:48 -0500
Log message to try to detect error in buffers.c svn:r13633
Diffstat (limited to 'src')
-rw-r--r--src/or/buffers.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/or/buffers.c b/src/or/buffers.c
index e025a5b2bc..1f0d64d4b3 100644
--- a/src/or/buffers.c
+++ b/src/or/buffers.c
@@ -1020,8 +1020,17 @@ buf_find_pos_of_char(char ch, buf_pos_t *out)
const chunk_t *chunk;
int pos;
tor_assert(out);
- if (out->chunk)
+ if (out->chunk) {
+ if (!(out->pos < (off_t)out->chunk->datalen)) {
+ log_warn(LD_BUG, "About to assert. %p, %d, %d, %p, %d.",
+ out, (int)out->pos,
+ (int)out->chunk_pos, out->chunk,
+ out->chunk?(int)out->chunk->datalen : (int)-1
+ );
+ /*XXXX020 remove this once the bug it detects is fixed. */
+ }
tor_assert(out->pos < (off_t)out->chunk->datalen);
+ }
pos = out->pos;
for (chunk = out->chunk; chunk; chunk = chunk->next) {
char *cp = memchr(chunk->data+pos, ch, chunk->datalen-pos);