changeset 1333:6fafb500de88

reduce buf->pos if shrinking
author Matt Johnston <matt@ucc.asn.au>
date Sat, 13 May 2017 23:43:09 +0800
parents 6aaec171e88e
children c8114a48837c
files buffer.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/buffer.c	Thu Sep 15 21:43:57 2016 +0800
+++ b/buffer.c	Sat May 13 23:43:09 2017 +0800
@@ -109,6 +109,7 @@
 		dropbear_exit("Bad buf_setlen");
 	}
 	buf->len = len;
+	buf->pos = MIN(buf->pos, buf->len);
 }
 
 /* Increment the length of the buffer */