From 29669846475e00340e3c981230f066edbf56ef45 Mon Sep 17 00:00:00 2001 From: Maksym Sobolyev Date: Tue, 10 Sep 2024 12:32:39 -0700 Subject: [PATCH] Fix logic inversion that can lead to the out-of-the-bounds write and subsequent corryption of the refcounter, causing memory leak with oss-fuzz. --- src/rtpp_command_reply.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtpp_command_reply.c b/src/rtpp_command_reply.c index 23dc3e66..f7f67b63 100644 --- a/src/rtpp_command_reply.c +++ b/src/rtpp_command_reply.c @@ -92,7 +92,7 @@ DEFINE_SMETHODS(rtpc_reply, #define CBP(pvt) ((pvt)->buf.r + (pvt)->buf.ulen) #define CBL(pvt) ((pvt)->buf.ulen) #define CBRL(pvt, fin) (sizeof(pvt->buf.r) - (pvt)->buf.ulen - \ - ((fin) ? (pvt)->buf.rlen : 0)) + ((fin) ? 0 : (pvt)->buf.rlen)) #define CBP_C(pvt) ((pvt)->buf.r + (pvt)->buf.clen) #define CBL_C(pvt) ((pvt)->buf.clen)