aboutsummaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 52b4c8966..d007e8814 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -289,8 +289,13 @@ static void read_rewind(struct connectdata *conn,
size_t show;
show = MIN(conn->buf_len - conn->read_pos, sizeof(buf)-1);
- memcpy(buf, conn->master_buffer + conn->read_pos, show);
- buf[show] = '\0';
+ if (conn->master_buffer) {
+ memcpy(buf, conn->master_buffer + conn->read_pos, show);
+ buf[show] = '\0';
+ }
+ else {
+ buf[0] = '\0';
+ }
DEBUGF(infof(conn->data,
"Buffer after stream rewind (read_pos = %d): [%s]",