mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-18 20:57:56 +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;
|
*bufp = rb->cursor;
|
||||||
*lenp = rb->ebuf - rb->cursor;
|
*lenp = rb->ebuf - rb->cursor;
|
||||||
rb->cursor = rb->buf;
|
rb->cursor = rb->buf;
|
||||||
|
if (rb->cursor == rb->start)
|
||||||
|
++rb->wrap;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
*bufp = rb->cursor;
|
*bufp = rb->cursor;
|
||||||
|
Loading…
Reference in New Issue
Block a user