Package: hyperestraier
Version: 1.4.9-1.4
Severity: important
Tags: patch
User: debian-h...@lists.debian.org
Usertags: hurd

Hi,

as shown in [1] (even if for version 1.4.9-1.3), currently hyperestraier does
not build on GNU/Hurd. The problem is the unconditional usage of the PATH_MAX
constant, not POSIX.
The easy fix is to malloc+free the two buffers currently stack-allocated of
PATH_MAX size; patch attached.

[1] 
http://buildd.debian-ports.org/fetch.php?&pkg=hyperestraier&ver=1.4.9-1.3&arch=hurd-i386&stamp=1211156773&file=log&as=raw

Thanks,
-- 
Pino
--- a/estseek.c
+++ b/estseek.c
@@ -1489,13 +1489,15 @@
 static void expandquery(const char *word, CBLIST *result){
   CBLIST *words;
   const char *tmpdir;
-  char oname[PATH_MAX], cmd[PATH_MAX], *ebuf;
+  char *oname, *cmd, *ebuf;
   int i;
   cblistpush(result, word, -1);
   tmpdir = getenv("TMP");
   if(!tmpdir) tmpdir = getenv("TEMP");
   if(!tmpdir) tmpdir = ESTPATHSTR "tmp";
+  oname = malloc(strlen(tmpdir) + 1 + strlen(g_scriptname) + 1 + 8 + 1);
   sprintf(oname, "%s%c%s.%08d", tmpdir, ESTPATHCHR, g_scriptname, (int)getpid());
+  cmd = malloc(strlen(g_qxpndcmd) + 3 + strlen(oname) + 1);
   sprintf(cmd, "%s > %s", g_qxpndcmd, oname);
   ebuf = cbsprintf("ESTWORD=%s", word);
   putenv(ebuf);
@@ -1509,6 +1511,8 @@
     cblistclose(words);
   }
   unlink(oname);
+  free(cmd);
+  free(oname);
 }
 
 

Reply via email to