Package: fontconfig
Version: 2.11.0-1
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hello,

fontconfig currently FTBFS on hurd-i386 because of using PATH_MAX
unconditionnally. The attached tested patch fixes this by using
a dynamically allocated buffer.

Samuel

-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.12.0 (SMP w/8 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages fontconfig depends on:
ii  fontconfig-config  2.11.0-1
ii  libc6              2.17-93
ii  libexpat1          2.1.0-4
ii  libfontconfig1     2.11.0-1
ii  libfreetype6       2.4.9-1.1

fontconfig recommends no packages.

fontconfig suggests no packages.

-- debconf information:
* fontconfig/hinting_type: Native
* fontconfig/subpixel_rendering: Automatic
  fontconfig/enable_bitmaps: false

-- 
Samuel
* y se leve dans 2h10
--- ./src/fcdefault.c.original  2013-11-10 00:14:14.000000000 +0100
+++ ./src/fcdefault.c   2013-11-10 00:24:59.000000000 +0100
@@ -150,15 +150,33 @@
 # if defined (HAVE_GETEXECNAME)
        const char *p = getexecname ();
 # else
-       char buf[PATH_MAX + 1];
-       int len;
+       int size = 128;
        char *p = NULL;
 
-       len = readlink ("/proc/self/exe", buf, sizeof (buf) - 1);
-       if (len != -1)
-       {
-           buf[len] = '\0';
-           p = buf;
+       while (1) {
+           char *buf = malloc (size);
+           int len;
+
+           if (buf == NULL)
+               break;
+
+           len = readlink ("/proc/self/exe", buf, size - 1);
+
+           if (len < 0)
+           {
+               free(buf);
+               break;
+           }
+
+           if (len < size - 1)
+           {
+               buf[len] = '\0';
+               p = buf;
+               break;
+           }
+
+           free (buf);
+           size *= 2;
        }
 # endif
        if (p)

Reply via email to