Skip to content

Commit 21c0ea4

Browse files
committed
CDRIVER-647: Fix invalid read in tracing on read failure
1 parent 2ae2658 commit 21c0ea4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/mongoc/mongoc-stream.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ mongoc_stream_readv (mongoc_stream_t *stream,
232232
BSON_ASSERT (stream->readv);
233233

234234
ret = stream->readv (stream, iov, iovcnt, min_bytes, timeout_msec);
235-
DUMP_IOVEC (readv, iov, iovcnt);
235+
if (ret >= 0) {
236+
DUMP_IOVEC (readv, iov, iovcnt);
237+
}
236238

237239
RETURN (ret);
238240
}

0 commit comments

Comments
 (0)