From patchwork Sat Mar 9 08:43:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivien Kraus X-Patchwork-Id: 61566 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 7225727BBE9; Sat, 9 Mar 2024 08:51:53 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id DBC6127BBE2 for ; Sat, 9 Mar 2024 08:51:51 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1risQe-0002fQ-OS; Sat, 09 Mar 2024 03:51:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1risQV-0002dN-GM for guix-patches@gnu.org; Sat, 09 Mar 2024 03:51:31 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1risQV-000098-7m for guix-patches@gnu.org; Sat, 09 Mar 2024 03:51:31 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1risR1-0003eq-Or for guix-patches@gnu.org; Sat, 09 Mar 2024 03:52:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69652] [PATCH gnome-team v2 3/3] gnu: orbit2: Fix bug on 32-bit systems. Resent-From: Vivien Kraus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 09 Mar 2024 08:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69652 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69652@debbugs.gnu.org Cc: rg@raghavgururajan.name, vivien@planete-kraus.eu, liliana.prikler@gmail.com, maxim.cournoyer@gmail.com Received: via spool by 69652-submit@debbugs.gnu.org id=B69652.170997427813979 (code B ref 69652); Sat, 09 Mar 2024 08:52:03 +0000 Received: (at 69652) by debbugs.gnu.org; 9 Mar 2024 08:51:18 +0000 Received: from localhost ([127.0.0.1]:60586 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risQH-0003dP-Sp for submit@debbugs.gnu.org; Sat, 09 Mar 2024 03:51:18 -0500 Received: from planete-kraus.eu ([89.234.140.182]:56370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1risQF-0003cj-81 for 69652@debbugs.gnu.org; Sat, 09 Mar 2024 03:51:15 -0500 Received: from planete-kraus.eu (localhost [127.0.0.1]) by planete-kraus.eu (OpenSMTPD) with ESMTP id 8b78fd01; Sat, 9 Mar 2024 08:50:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=planete-kraus.eu; h= message-id:in-reply-to:references:from:date:subject:to:cc :mime-version; s=albinoniA; bh=2LJiRewNXuaPpV19jFM3RUfAinE=; b=E OxvDc/xWbHVyFKt+JcI8zSoPj5SuC2CmRXueP0eCRRwbyoD/9XIOO6lb2hO465yh jnnsg9G4WzGETaMW9Le6RqLlyqiasGzgeP7frFk0uBlaH0mBiJkuSXHH/3utzPI+ 5mC2YR6VTdZnhHYApya2SK65qdvIOjzGIInqsFiiMvKzPy9bW+LFpjpAnoz+kPYn SZU5RoNnIqphYyOcbOHj4190DnJfDTEO0tRS5Bx5JPvvJ5Oz239/p9TerIF6FyUN 5UtYUTz6rjJqTSeGsnk1z3PERQEFav9OEykkwWO09OBOg2m4oodbfzp8HjVskHjr aMVMTZ0ALWChm6ZTPlGDg== Received: by planete-kraus.eu (OpenSMTPD) with ESMTPSA id d804878e (TLSv1.3:TLS_CHACHA20_POLY1305_SHA256:256:NO); Sat, 9 Mar 2024 08:50:39 +0000 (UTC) Message-ID: <6bb82d56807c366da0609ea763a01b18205baf2b.1709974034.git.vivien@planete-kraus.eu> In-Reply-To: References: Date: Sat, 9 Mar 2024 09:43:19 +0100 MIME-Version: 1.0 User-Agent: Evolution 3.48.4 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Vivien Kraus X-ACL-Warn: , Vivien Kraus via Guix-patches X-Patchwork-Original-From: Vivien Kraus via Guix-patches via From: Vivien Kraus Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/patches/orbit2-fix-array-allocation-32bit.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it here. * gnu/packages/gnome.scm (orbit2): Use it here. Change-Id: I72e10fc9d8a5421a7ec6b4ccf1425008b322ea3f --- gnu/local.mk | 1 + gnu/packages/gnome.scm | 4 +- .../orbit2-fix-array-allocation-32bit.patch | 40 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/orbit2-fix-array-allocation-32bit.patch diff --git a/gnu/local.mk b/gnu/local.mk index dcd320fec4..9fbfc754a0 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1781,6 +1781,7 @@ dist_patch_DATA = \ %D%/packages/patches/opentaxsolver-file-browser-fix.patch \ %D%/packages/patches/open-zwave-hidapi.patch \ %D%/packages/patches/orangeduck-mpc-fix-pkg-config.patch \ + %D%/packages/patches/orbit2-fix-array-allocation-32bit.patch \ %D%/packages/patches/orpheus-cast-errors-and-includes.patch \ %D%/packages/patches/osip-CVE-2017-7853.patch \ %D%/packages/patches/ots-no-include-missing-file.patch \ diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 8b69a231af..103065141e 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -3797,7 +3797,9 @@ (define-public orbit2 upstream-name "-" version ".tar.bz2"))) (sha256 (base32 - "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam")))) + "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam")) + (patches + (search-patches "orbit2-fix-array-allocation-32bit.patch")))) (build-system gnu-build-system) (arguments (list diff --git a/gnu/packages/patches/orbit2-fix-array-allocation-32bit.patch b/gnu/packages/patches/orbit2-fix-array-allocation-32bit.patch new file mode 100644 index 0000000000..377c09d0a5 --- /dev/null +++ b/gnu/packages/patches/orbit2-fix-array-allocation-32bit.patch @@ -0,0 +1,40 @@ +From 28067b88ad91e794675734bc92bd9c8653b4a46a Mon Sep 17 00:00:00 2001 +Message-ID: <28067b88ad91e794675734bc92bd9c8653b4a46a.1709973702.git.vivien@planete-kraus.eu> +From: Vivien Kraus +Date: Sat, 9 Mar 2024 09:36:56 +0100 +Subject: [PATCH] corba-loc: Do not allocate more tokens than necessary. + +To split the list of locations, the code calls g_strsplit with the +last argument set to G_MAXINT. It means that g_strsplit will try to +allocate a huge array (G_MAXINT + 1, for the final NULL), mostly +filled with NULL. Unfortunately, on 32-bit systems, this is one past +the authorized length for an array. Previous versions of glib would +not care, but the new version now raises an error if this happens. + +To get an array of the appropriate size, we can just pass -1 to the +last argument. + +* src/orb/orb-core/corba-loc.c (ORBit_corbaloc_parse): Replace +G_MAXINT with -1. +--- + src/orb/orb-core/corba-loc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/orb/orb-core/corba-loc.c b/src/orb/orb-core/corba-loc.c +index abfcaa29..6492d392 100644 +--- a/src/orb/orb-core/corba-loc.c ++++ b/src/orb/orb-core/corba-loc.c +@@ -309,7 +309,7 @@ ORBit_corbaloc_parse (const gchar *corbaloc) + if (!(objkey = orbit_url_decode (okey))) + goto ret_error; + +- if (!(token = g_strsplit (loc, ",", G_MAXINT))) ++ if (!(token = g_strsplit (loc, ",", -1))) + goto ret_error; + + /* [ 'iiop' ] ':' [ '//' ] [ version '@' ] host [ ':' port ] */ + +base-commit: 144be2e9860286c83f009e7689250e0af977cc5e +-- +2.41.0 +