<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [patch] Fix build on Hurd without PATH_MAX"
href="https://bugs.freedesktop.org/show_bug.cgi?id=74313#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - [patch] Fix build on Hurd without PATH_MAX"
href="https://bugs.freedesktop.org/show_bug.cgi?id=74313">bug 74313</a>
from <span class="vcard"><a class="email" href="mailto:pere@hungry.com" title="Petter Reinholdtsen <pere@hungry.com>"> <span class="fn">Petter Reinholdtsen</span></a>
</span></b>
<pre>You are right. Sorry. I got so excided when I got it building I forgot to
update the snprintf() call too.
Here is an updated patch.
--- spice-0.12.4.orig/server/tests/test_display_base.c
+++ spice-0.12.4/server/tests/test_display_base.c
@@ -87,12 +87,14 @@ static void regression_test(void)
pid = fork();
if (pid == 0) {
- char buf[PATH_MAX];
+ int buflen = strlen(getenv("PATH"))+6;
+ char *buf = malloc(buflen);
char *argp[] = {NULL};
char *envp[] = {buf, NULL};
- snprintf(buf, sizeof(buf), "PATH=%s", getenv("PATH"));
+ snprintf(buf, buflen, "PATH=%s", getenv("PATH"));
execve("regression_test.py", argp, envp);
+ free(buf); /* In case the exec fail */
} else if (pid > 0) {
return;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>