Commit 01bde8ff authored by Matt Johnston's avatar Matt Johnston
Browse files

reduce buf->pos if shrinking

parent eed0e2e4
...@@ -109,6 +109,7 @@ void buf_setlen(buffer* buf, unsigned int len) { ...@@ -109,6 +109,7 @@ void buf_setlen(buffer* buf, unsigned int len) {
dropbear_exit("Bad buf_setlen"); dropbear_exit("Bad buf_setlen");
} }
buf->len = len; buf->len = len;
buf->pos = MIN(buf->pos, buf->len);
} }
/* Increment the length of the buffer */ /* Increment the length of the buffer */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment