]> granicus.if.org Git - p11-kit/commitdiff
Add workaround for broken strndup() in firefox
authorStef Walter <stefw@gnome.org>
Mon, 18 Mar 2013 19:03:57 +0000 (20:03 +0100)
committerStef Walter <stefw@gnome.org>
Mon, 18 Mar 2013 19:05:11 +0000 (20:05 +0100)
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

configure.ac

index b0d47031e6eab24341593d529ac1a4e3ca160179..02e779394654369e9a9ca05f097e9549710de962 100644 (file)
@@ -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])],