summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-03-18 20:03:57 +0100
committerStef Walter <stefw@gnome.org>2013-03-18 20:05:11 +0100
commitf40e5f7129ece4b74aa2cb23b28b24b381bbe223 (patch)
tree61b87b5cdc3d4ad2b5b40675a5b7b304e0d806bc
parent749c0cdfeb3b7cc86165deb1cc51c32c0768a149 (diff)
Add workaround for broken strndup() in firefox
Unconditionally use our own strndup() until this issue is resolved and in the stable versions of various distros. See: https://bugzilla.mozilla.org/show_bug.cgi?id=826171
-rw-r--r--configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index b0d4703..02e7793 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,10 +78,15 @@ if test "$os_unix" = "yes"; then
# These are thngs we can work around
AC_CHECK_MEMBERS([struct dirent.d_type],,,[#include <dirent.h>])
AC_CHECK_FUNCS([getprogname getexecname basename mkstemp mkdtemp])
- AC_CHECK_FUNCS([strnstr memdup strndup])
+ AC_CHECK_FUNCS([strnstr memdup])
AC_CHECK_FUNCS([asprintf vasprintf vsnprintf])
AC_CHECK_FUNCS([timegm])
+ # WORKAROUND: So in lots of released builds of firefox a completely broken strndup()
+ # is present. It does not NULL terminate its string output. It is unconditionally
+ # defined, and overrides the libc strndup() function on platforms where it
+ # exists. For this reason we (for now) unconditionally define strndup().
+
# Required functions
AC_CHECK_FUNCS([gmtime_r],
[AC_DEFINE([HAVE_GMTIME_R], 1, [Whether gmtime_r() is available])],