reduce buf->pos if shrinking

This commit is contained in:
Matt Johnston 2017-05-13 23:43:09 +08:00
parent eed0e2e431
commit 01bde8ff94

View File

@ -109,6 +109,7 @@ void buf_setlen(buffer* buf, unsigned int len) {
dropbear_exit("Bad buf_setlen");
}
buf->len = len;
buf->pos = MIN(buf->pos, buf->len);
}
/* Increment the length of the buffer */