mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-04-25 13:30:04 +00:00
Fix bug in rotbuf_next_chunk() when rotation == 0
Caused occasional infinite loop in "keyring add" command and others
This commit is contained in:
parent
118dcca40b
commit
3c8643289e
2
rotbuf.c
2
rotbuf.c
@ -52,6 +52,8 @@ int rotbuf_next_chunk(struct rotbuf *rb, unsigned char **bufp, size_t *lenp)
|
||||
*bufp = rb->cursor;
|
||||
*lenp = rb->ebuf - rb->cursor;
|
||||
rb->cursor = rb->buf;
|
||||
if (rb->cursor == rb->start)
|
||||
++rb->wrap;
|
||||
return 1;
|
||||
}
|
||||
*bufp = rb->cursor;
|
||||
|
Loading…
x
Reference in New Issue
Block a user