From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 38A0D13835A for ; Sat, 5 Jun 2021 20:09:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 441F6E08E8; Sat, 5 Jun 2021 20:09:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 09E61E08D3 for ; Sat, 5 Jun 2021 20:09:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 633BD340D74 for ; Sat, 5 Jun 2021 20:09:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F23717A1 for ; Sat, 5 Jun 2021 20:09:49 +0000 (UTC) From: "Lars Wendler" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Lars Wendler" Message-ID: <1622923757.c458266658aadf51451562dd8fe14eeca1071cfc.polynomial-c@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: media-sound/alsa-utils/, media-sound/alsa-utils/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: media-sound/alsa-utils/alsa-utils-1.2.5-r1.ebuild media-sound/alsa-utils/alsa-utils-1.2.5.ebuild media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-potential-null-pointer-from-strchr.patch media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-the-nested-iteration.patch X-VCS-Directories: media-sound/alsa-utils/ media-sound/alsa-utils/files/ X-VCS-Committer: polynomial-c X-VCS-Committer-Name: Lars Wendler X-VCS-Revision: c458266658aadf51451562dd8fe14eeca1071cfc X-VCS-Branch: master Date: Sat, 5 Jun 2021 20:09:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d02b7903-6ed6-4f74-be4e-935dea0041cc X-Archives-Hash: fffe634a306a86c5a76415395f987d94 commit: c458266658aadf51451562dd8fe14eeca1071cfc Author: Niklāvs Koļesņikovs <89q1r14hd relay firefox com> AuthorDate: Thu Jun 3 20:17:57 2021 +0000 Commit: Lars Wendler gentoo org> CommitDate: Sat Jun 5 20:09:17 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4582666 media-sound/alsa-utils: adds two likely relevant upstream patches Adds an upstream commit as a patch that according to Joakim Tjernlund accompanies the one we need to fix alsa-lib 1.2.5 missing many HDMI profiles. Additionally adds another patch that fixes a possible crash. Thanks-to: Joakim Tjernlund infinera.com> Bug: https://bugs.gentoo.org/793410 Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd relay.firefox.com> Signed-off-by: Lars Wendler gentoo.org> ...ils-1.2.5.ebuild => alsa-utils-1.2.5-r1.ebuild} | 2 + ....5-fix-potential-null-pointer-from-strchr.patch | 49 ++++++++++++++++++++++ ...alsa-utils-1.2.5-fix-the-nested-iteration.patch | 28 +++++++++++++ 3 files changed, 79 insertions(+) diff --git a/media-sound/alsa-utils/alsa-utils-1.2.5.ebuild b/media-sound/alsa-utils/alsa-utils-1.2.5-r1.ebuild similarity index 93% rename from media-sound/alsa-utils/alsa-utils-1.2.5.ebuild rename to media-sound/alsa-utils/alsa-utils-1.2.5-r1.ebuild index 507876a36c1..fb1160d0c31 100644 --- a/media-sound/alsa-utils/alsa-utils-1.2.5.ebuild +++ b/media-sound/alsa-utils/alsa-utils-1.2.5-r1.ebuild @@ -24,6 +24,8 @@ RDEPEND="${CDEPEND} BDEPEND="virtual/pkgconfig" PATCHES=( + "${FILESDIR}"/${PN}-1.2.5-fix-the-nested-iteration.patch # bug #793410 + "${FILESDIR}"/${PN}-1.2.5-fix-potential-null-pointer-from-strchr.patch # bug #793410 "${FILESDIR}"/${PN}-1.1.8-missing_header.patch ) diff --git a/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-potential-null-pointer-from-strchr.patch b/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-potential-null-pointer-from-strchr.patch new file mode 100644 index 00000000000..f06756a8af9 --- /dev/null +++ b/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-potential-null-pointer-from-strchr.patch @@ -0,0 +1,49 @@ +From 3d7a6facd9e1f962eef6c4ba3aa4cdc22477a6ac Mon Sep 17 00:00:00 2001 +From: Chao Song +Date: Mon, 31 May 2021 10:29:57 +0800 +Subject: [PATCH] topology: fix potential null pointer from strchr + +This patch adds check to the return pointer from strchr, +because it may be null and cause segment fault, if component +is not properly constructed. + +Fixes: https://github.com/alsa-project/alsa-utils/pull/91 +Signed-off-by: Chao Song +Signed-off-by: Jaroslav Kysela +--- + topology/pre-process-dapm.c | 5 +++++ + topology/pre-process-object.c | 5 +++++ + 2 files changed, 10 insertions(+) + +diff --git a/topology/pre-process-dapm.c b/topology/pre-process-dapm.c +index 450ca717..dbaf2f11 100644 +--- a/topology/pre-process-dapm.c ++++ b/topology/pre-process-dapm.c +@@ -146,6 +146,11 @@ static int tplg_pp_get_widget_name(struct tplg_pre_processor *tplg_pp, + + /* get class name */ + args = strchr(string, '.'); ++ if (!args) { ++ SNDERR("Error getting class name for %s\n", string); ++ return -EINVAL; ++ } ++ + class_name = calloc(1, strlen(string) - strlen(args) + 1); + if (!class_name) + return -ENOMEM; +diff --git a/topology/pre-process-object.c b/topology/pre-process-object.c +index 09aa3758..ac8caeca 100644 +--- a/topology/pre-process-object.c ++++ b/topology/pre-process-object.c +@@ -492,6 +492,11 @@ static int tplg_pp_add_object_tuple_section(struct tplg_pre_processor *tplg_pp, + } + + type = strchr(token_ref, '.'); ++ if(!type) { ++ SNDERR("Error getting type for %s\n", token_ref); ++ return -EINVAL; ++ } ++ + token = calloc(1, strlen(token_ref) - strlen(type) + 1); + if (!token) + return -ENOMEM; diff --git a/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-the-nested-iteration.patch b/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-the-nested-iteration.patch new file mode 100644 index 00000000000..e175287a559 --- /dev/null +++ b/media-sound/alsa-utils/files/alsa-utils-1.2.5-fix-the-nested-iteration.patch @@ -0,0 +1,28 @@ +From 78212445de4c8e07873cbc7dff2abcacd031f151 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Tue, 1 Jun 2021 17:47:42 +0200 +Subject: [PATCH] alsactl: fix the nested iteration + +There may be nested iterations for hw: card names. +Handle this card name in snd_card_iterator_sinit(). + +BugLink: https://github.com/alsa-project/alsa-lib/issues/142 +Fixes: eefc2c6 ("alsactl: use card iterator functions for all card loops") +Signed-off-by: Jaroslav Kysela +--- + alsactl/utils.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/alsactl/utils.c b/alsactl/utils.c +index c79fd951..881b5053 100644 +--- a/alsactl/utils.c ++++ b/alsactl/utils.c +@@ -247,6 +247,8 @@ int snd_card_iterator_sinit(struct snd_card_iterator *iter, const char *cardname + int cardno = -1; + + if (cardname) { ++ if (strncmp(cardname, "hw:", 3) == 0) ++ cardname += 3; + cardno = snd_card_get_index(cardname); + if (cardno < 0) { + error("Cannot find soundcard '%s'...", cardname);