package/libvncserver: fix CVE-2020-29260

libvncclient v0.9.13 was discovered to contain a memory leak via the
function rfbClientCleanup().

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022.11.x
Fabrice Fontaine 2022-11-13 22:55:58 +01:00 committed by Thomas Petazzoni
parent 191fa1718f
commit b3ab978703
2 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,28 @@
From bef41f6ec4097a8ee094f90a1b34a708fbd757ec Mon Sep 17 00:00:00 2001
From: Christian Beier <info@christianbeier.net>
Date: Sat, 21 Nov 2020 12:52:31 +0100
Subject: [PATCH] libvncclient: free vncRec memory in rfbClientCleanup()
Otherwise we leak memory. Spotted by Ramin Farajpour Cami
<ramin.blackhat@gmail.com>, thanks!
[Retrieved from:
https://github.com/LibVNC/libvncserver/commit/bef41f6ec4097a8ee094f90a1b34a708fbd757ec]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
libvncclient/vncviewer.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c
index d6b91f02b..0a1bdcf6a 100644
--- a/libvncclient/vncviewer.c
+++ b/libvncclient/vncviewer.c
@@ -534,6 +534,8 @@ void rfbClientCleanup(rfbClient* client) {
client->clientData = next;
}
+ free(client->vncRec);
+
if (client->sock != RFB_INVALID_SOCKET)
rfbCloseSocket(client->sock);
if (client->listenSock != RFB_INVALID_SOCKET)

View File

@ -14,6 +14,9 @@ LIBVNCSERVER_INSTALL_STAGING = YES
LIBVNCSERVER_DEPENDENCIES = host-pkgconf lzo
LIBVNCSERVER_CONF_OPTS = -DWITH_LZO=ON
# 0002-libvncclient-free-vncRec-memory-in-rfbClientCleanup.patch
LIBVNCSERVER_IGNORE_CVES += CVE-2020-29260
# only used for examples
LIBVNCSERVER_CONF_OPTS += \
-DWITH_FFMPEG=OFF \