From 0cd6f26b6b8fcec2b43398fd831f6b9e0cb977e3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:18:09 +0200 Subject: Merging upstream version 115.9.0esr. Signed-off-by: Daniel Baumann --- security/nss/lib/ssl/sslsecur.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'security/nss/lib/ssl') diff --git a/security/nss/lib/ssl/sslsecur.c b/security/nss/lib/ssl/sslsecur.c index 4a05637039..522e4f4114 100644 --- a/security/nss/lib/ssl/sslsecur.c +++ b/security/nss/lib/ssl/sslsecur.c @@ -488,7 +488,12 @@ ssl_SendSavedWriteData(sslSocket *ss) if (rv < 0) { return rv; } - ss->pendingBuf.len -= rv; + if (rv > ss->pendingBuf.len) { + PORT_Assert(0); /* This shouldn't happen */ + ss->pendingBuf.len = 0; + } else { + ss->pendingBuf.len -= rv; + } if (ss->pendingBuf.len > 0 && rv > 0) { /* UGH !! This shifts the whole buffer down by copying it */ PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv, -- cgit v1.2.3