Fix an off-by-one waiting to happen
authorvolpol <volpol@packet-gain.de>
Wed, 9 Sep 2020 09:37:23 +0000 (11:37 +0200)
committervolpol <volpol@packet-gain.de>
Wed, 9 Sep 2020 18:24:26 +0000 (20:24 +0200)
ring.c

diff --git a/ring.c b/ring.c
index 78224aa05211f9a41a8ce99dd2b3731cf11af279..7b2a98b821f5f472ef9ed443d573c35687436f92 100644 (file)
--- a/ring.c
+++ b/ring.c
@@ -28,7 +28,7 @@ void ring_add(void *data, size_t len){
         wrapped = 1;
         w1 = 0;
     } else
-    if (len <= rest){
+    if (len < rest){
         memcpy(ring + w1, data, len);
         w1 += len;
     } else {