Github messages for voidlinux
 help / color / mirror / Atom feed
From: pascal-huber <pascal-huber@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] teeworlds: fix CVE-2021-43518
Date: Sun, 16 Apr 2023 15:59:15 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43479@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

There is a new pull request by pascal-huber against master on the void-packages repository

https://github.com/pascal-huber/void-packages teeworlds_cve-2021-43518
https://github.com/void-linux/void-packages/pull/43479

teeworlds: fix CVE-2021-43518
#### Testing the changes
- I tested the changes in this PR: **briefly** (just playing the game, not the vulnerability)

#### Local build testing
- I built this PR locally for my native architecture, x86_64-glibc
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - x86_64-musl (crossbuild)
  - armv7l-glibc (crossbuild)
  - aarch64b-glibc (crossbuild)



A patch file from https://github.com/void-linux/void-packages/pull/43479.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-teeworlds_cve-2021-43518-43479.patch --]
[-- Type: text/x-diff, Size: 2857 bytes --]

From 7722a093ab0692c8af14b5d964d3a1cf63e7bd29 Mon Sep 17 00:00:00 2001
From: Pascal Huber <pascal.huber@resolved.ch>
Date: Sun, 16 Apr 2023 15:24:03 +0200
Subject: [PATCH] teeworlds: fix CVE-2021-43518

---
 .../teeworlds/patches/CVE-2021-43518.patch    | 38 +++++++++++++++++++
 srcpkgs/teeworlds/template                    |  2 +-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/teeworlds/patches/CVE-2021-43518.patch

diff --git a/srcpkgs/teeworlds/patches/CVE-2021-43518.patch b/srcpkgs/teeworlds/patches/CVE-2021-43518.patch
new file mode 100644
index 0000000000000..5776dd815d572
--- /dev/null
+++ b/srcpkgs/teeworlds/patches/CVE-2021-43518.patch
@@ -0,0 +1,38 @@
+upstream issue: https://github.com/teeworlds/teeworlds/issues/2981
+upstream fix: https://github.com/teeworlds/teeworlds/pull/3018
+patch source: https://sources.debian.org/src/teeworlds/0.7.5-2/debian/patches/CVE-2021-43518.patch/
+
+Backport 91e5492d4c210f82f1ca6b43a73417fef5463368 as the hotfix for CVE-2021-43518
+
+--- teeworlds-0.7.5.orig/src/game/client/components/maplayers.cpp
++++ teeworlds-0.7.5/src/game/client/components/maplayers.cpp
+@@ -254,7 +254,7 @@ void CMapLayers::LoadEnvPoints(const CLa
+ 				p.m_Time = pEnvPoint_v1->m_Time;
+ 				p.m_Curvetype = pEnvPoint_v1->m_Curvetype;
+ 
+-				for(int c = 0; c < pItem->m_Channels; c++)
++				for(int c = 0; c < min(pItem->m_Channels, 4); c++)
+ 				{
+ 					p.m_aValues[c] = pEnvPoint_v1->m_aValues[c];
+ 					p.m_aInTangentdx[c] = 0;
+--- teeworlds-0.7.5.orig/src/game/editor/io.cpp
++++ teeworlds-0.7.5/src/game/editor/io.cpp
+@@ -478,7 +478,8 @@ int CEditorMap::Load(class IStorage *pSt
+ 			for(int e = 0; e < Num; e++)
+ 			{
+ 				CMapItemEnvelope *pItem = (CMapItemEnvelope *)DataFile.GetItem(Start+e, 0, 0);
+-				CEnvelope *pEnv = new CEnvelope(pItem->m_Channels);
++				const int Channels = min(pItem->m_Channels, 4);
++				CEnvelope *pEnv = new CEnvelope(Channels);
+ 				pEnv->m_lPoints.set_size(pItem->m_NumPoints);
+ 				for(int n = 0; n < pItem->m_NumPoints; n++)
+ 				{
+@@ -495,7 +496,7 @@ int CEditorMap::Load(class IStorage *pSt
+ 						pEnv->m_lPoints[n].m_Time = pEnvPoint_v1->m_Time;
+ 						pEnv->m_lPoints[n].m_Curvetype = pEnvPoint_v1->m_Curvetype;
+ 
+-						for(int c = 0; c < pItem->m_Channels; c++)
++						for(int c = 0; c < Channels; c++)
+ 						{
+ 							pEnv->m_lPoints[n].m_aValues[c] = pEnvPoint_v1->m_aValues[c];
+ 						}
diff --git a/srcpkgs/teeworlds/template b/srcpkgs/teeworlds/template
index e1df31fc818d8..f88f89f158a19 100644
--- a/srcpkgs/teeworlds/template
+++ b/srcpkgs/teeworlds/template
@@ -1,7 +1,7 @@
 # Template file for 'teeworlds'
 pkgname=teeworlds
 version=0.7.5
-revision=2
+revision=3
 hostmakedepends="bam python3 pkg-config"
 makedepends="zlib-devel SDL2-devel glu-devel freetype-devel"
 short_desc="Retro multiplayer shooter"

             reply	other threads:[~2023-04-16 13:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 13:59 pascal-huber [this message]
2023-04-19  8:13 ` [PR PATCH] [Merged]: " sgn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-43479@inbox.vuxu.org \
    --to=pascal-huber@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).