diff buffer.c @ 1355:3fdd8c5a0195 fuzz

merge main to fuzz
author Matt Johnston <matt@ucc.asn.au>
date Thu, 18 May 2017 23:45:10 +0800
parents ce0931b7f4c2 6fafb500de88
children 665dd8957a67
line wrap: on
line diff
--- a/buffer.c	Thu May 18 23:38:30 2017 +0800
+++ b/buffer.c	Thu May 18 23:45:10 2017 +0800
@@ -109,7 +109,7 @@
 		dropbear_exit("Bad buf_setlen");
 	}
 	buf->len = len;
-	buf->pos = 0;
+	buf->pos = MIN(buf->pos, buf->len);
 }
 
 /* Increment the length of the buffer */