]> git.proxmox.com Git - mirror_frr.git/commit
lib: fix a few bugs in ring buffers
authorQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Jan 2018 18:58:53 +0000 (13:58 -0500)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Wed, 3 Jan 2018 19:04:43 +0000 (14:04 -0500)
commit74e4a329a34b1d1ad5e3ee5653ae3b7f0680c9fe
treef7ec930d50ab493f46bd4d8a2665b9ac8ab5b2d1
parentcb94eaebffb96aded4784fd89221b11f22336c6a
lib: fix a few bugs in ring buffers

* Fix rare failure caused when end pointer is at end of buffer memory
  and a call to ringbuf_get() is made that reads all of the data in the
  buffer; start pointer was advanced past end pointer, causing some
  special handling to be skipped
* Fix ringbuf_peek() moving start pointer
* Fix use after free
* Remove extraneous assignment
* Update relevant tests

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
lib/ringbuf.c
tests/lib/test_ringbuf.c