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

Bug#745485: xdebug: FTBFS on hurd-i386



Source: xdebug
Version: 2.2.4-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd

Hi,

Currently xdebug fails to build from source due to PATH_MAX being used,
and that constant is not defined on GNU/Hurd. The attached patch avoid
using PATH_MAX by allocating the string dfp with xdstrdup() and free it
when not needed any longer.

Thanks!


--- a/xdebug-2.2.4/usefulstuff.c
+++ b/xdebug-2.2.4/usefulstuff.c
@@ -284,16 +284,16 @@ char *xdebug_raw_url_encode(char const *
 char *xdebug_path_from_url(const char *fileurl TSRMLS_DC)
 {
 	/* deal with file: url's */
-	char dfp[PATH_MAX * 2];
-	const char *fp = dfp, *efp = fileurl;
+	char *dfp = NULL;
+	const char *fp = NULL, *efp = fileurl;
 #ifdef PHP_WIN32
 	int l = 0;
 	int i;
 #endif
-	char *tmp = NULL, *ret = NULL;;
+	char *tmp = NULL, *ret = NULL;
 
-	memset(dfp, 0, sizeof(dfp));
-	strncpy(dfp, efp, sizeof(dfp) - 1);
+	dfp = xdstrdup(efp);
+	fp = dfp;
 	xdebug_raw_url_decode(dfp, strlen(dfp));
 	tmp = strstr(fp, "file://");
 
@@ -316,6 +316,7 @@ char *xdebug_path_from_url(const char *f
 		ret = xdstrdup(fileurl);
 	}
 
+	free(dfp);
 	return ret;
 }
 

Reply to: