guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add fontconfig-path-max.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: Add fontconfig-path-max.
Date: Mon, 04 Jul 2016 10:21:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Oops, I spoke too fast.

address@hidden skribis:

> +++ b/gnu/packages/patches/fontconfig-fcdefault.patch
> @@ -0,0 +1,23 @@
> +This patch replaces the use of macro PATH_MAX by *buf constant,
> +which allows dynamic memory allocation.
> +
> +---
> + src/fcdefault.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/src/fcdefault.c b/src/fcdefault.c
> +index 6647a8f..8e2094f 100644
> +--- a/src/fcdefault.c
> ++++ b/src/fcdefault.c
> +@@ -150,7 +150,7 @@ retry:
> + # if defined (HAVE_GETEXECNAME)
> +     const char *p = getexecname ();
> + # elif defined (HAVE_READLINK)
> +-    char buf[PATH_MAX + 1];
> ++    char *buf;

[...]

> +     struct stat statb;
> +-    char f[PATH_MAX + 1];
> ++    char *f;

With these changes, the code compiles but will crash at run time,
because ‘f’ and ‘buf’ are dangling pointers.

We should instead use ‘01_path_max.patch’ from
<http://http.debian.net/debian/pool/main/f/fontconfig/fontconfig_2.11.0-6.3.debian.tar.xz>.

(In general, for PATH_MAX issues, Debian very likely already has a
patch.)

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]