Oops, I spoke too fast.

ren...@openmailbox.org 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