mirror of
https://github.com/clearml/dropbear
synced 2025-06-26 18:17:32 +00:00
reduce buf->pos if shrinking
This commit is contained in:
parent
eed0e2e431
commit
01bde8ff94
1
buffer.c
1
buffer.c
@ -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 */
|
||||||
|
Loading…
Reference in New Issue
Block a user