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 54837821e425324fa34ab6ddf'>diff
path: root/tests/boot-parameters.scm
AgeCommit message (Collapse)Author
2020-12-21system: Allow separated /boot and encrypted root.Miguel Ángel Arruga Vivas
* gnu/bootloader/grub.scm (grub-configuration-file): New parameter store-crypto-devices. [crypto-devices]: New helper function. [builder]: Use crypto-devices. * gnu/machine/ssh.scm (roll-back-managed-host): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * gnu/tests/install.scm (%encrypted-root-not-boot-os, %encrypted-root-not-boot-os): New os declaration. (%encrypted-root-not-boot-installation-script): New script, whose contents were initially taken from %encrypted-root-installation-script. (%test-encrypted-root-not-boot-os): New test. * gnu/system.scm (define-module): Export operating-system-bootoader-crypto-devices and boot-parameters-store-crypto-devices. (<boot-parameters>): Add field store-crypto-devices. (read-boot-parameters): Parse store-crypto-devices field. [uuid-sexp->uuid]: New helper function extracted from device-sexp->device. (operating-system-bootloader-crypto-devices): New function. (operating-system-bootcfg): Use operating-system-bootloader-crypto-devices to provide its contents to the bootloader configuration generation process. (operating-system-boot-parameters): Add store-crypto-devices to the generated boot-parameters. (operating-system-boot-parameters-file): Likewise to the file with the serialized structure. * guix/scripts/system.scm (reinstall-bootloader): Use boot-parameters-store-crypto-devices to provide its contents to the bootloader configuration generation process. * tests/boot-parameters.scm (%default-store-crypto-devices): New variable. (%grub-boot-parameters, test-read-boot-parameters): Use %default-store-crypto-devices. (tests store-crypto-devices): New tests.
2020-11-01system: Add store-directory-prefix to boot-parameters.Miguel Ángel Arruga Vivas
Fixes <http://issues.guix.gnu.org/44196> * gnu/machine/ssh.scm (roll-back-managed-host): Use boot-parameters-store-directory-prefix. * gnu/system.scm (define-module): Export boot-parameters-store-directory-prefix. (<boot-parameters>)[store-directory-prefix]: New field. It is used to generate the correct paths when /gnu/store is installed on a btrfs subvolume whose name doesn't match the final runtime path, as the bootloader doesn't have knowledge about the final mounting points. [boot-parameters-store-directory-prefix]: New accessor. (read-boot-parameters): Read directory-prefix from store field. (operating-system-boot-parameters-file): Add directory-prefix to store field. * guix/scripts/system.scm (reinstall-bootloader): Use boot-parameters-store-directory-prefix. * test/boot-parameters.scm (%default-btrfs-subvolume, %default-store-directory-prefix): New variables. (%grub-boot-parameters): Use %default-store-directory-prefix. (%default-operating-system): Use %default-btrfs-subvolume. (test-boot-parameters): Add directory-prefix. (test optional fields): Add test for directory-prefix. (test os store-directory-prefix): New test.
2020-10-18system: Add locale to boot-parameters.Miguel Ángel Arruga Vivas
* gnu/system.scm (define-module)[export]: Add boot-parameters-locale. (<boot-parameters>)[locale]: New field. [boot-parameters-locale]: New accessor. (read-boot-parameters): Read locale field. (operating-system-boot-parameters): Provide operating-system locale to boot-parameters record. (opeating-system-boot-parameters-file): Likewise. * Makefile.am (SCM_TESTS): Add tests/boot-parameters.scm. * tests/boot-parameters.scm: New test file.