@@ -0,0 +1,62 @@
1+--- b/modules/json-c/configure.ac
2++++ a/modules/json-c/configure.ac
3+@@ -75,7 +75,7 @@
4+ AC_FUNC_VPRINTF
5+ AC_FUNC_MEMCMP
6+ AC_CHECK_FUNCS([realloc])
7++AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf vasprintf open strncasecmp setlocale)
8+-AC_CHECK_FUNCS(strcasecmp strdup strerror snprintf vsnprintf open strncasecmp setlocale)
9+ AC_CHECK_DECLS([INFINITY], [], [], [[#include <math.h>]])
10+ AC_CHECK_DECLS([nan], [], [], [[#include <math.h>]])
11+ AC_CHECK_DECLS([isnan], [], [], [[#include <math.h>]])
12+--- b/modules/json-c/json_pointer.c
13++++ a/modules/json-c/json_pointer.c
14+@@ -208,7 +208,7 @@
15+ }
16+
17+ va_start(args, path_fmt);
18++ rc = vasprintf(&path_copy, path_fmt, args);
19+- rc = json_vasprintf(&path_copy, path_fmt, args);
20+ va_end(args);
21+
22+ if (rc < 0)
23+@@ -287,7 +287,7 @@
24+
25+ /* pass a working copy to the recursive call */
26+ va_start(args, path_fmt);
27++ rc = vasprintf(&path_copy, path_fmt, args);
28+- rc = json_vasprintf(&path_copy, path_fmt, args);
29+ va_end(args);
30+
31+ if (rc < 0)
32+--- b/modules/json-c/printbuf.c
33++++ a/modules/json-c/printbuf.c
34+@@ -129,7 +129,7 @@
35+ would have been written - this code handles both cases. */
36+ if(size == -1 || size > 127) {
37+ va_start(ap, msg);
38++ if((size = vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }
39+- if((size = json_vasprintf(&t, msg, ap)) < 0) { va_end(ap); return -1; }
40+ va_end(ap);
41+ printbuf_memappend(p, t, size);
42+ free(t);
43+--- b/modules/json-c/vasprintf_compat.h
44++++ a/modules/json-c/vasprintf_compat.h
45+@@ -8,8 +8,9 @@
46+
47+ #include "snprintf_compat.h"
48+
49++#if !defined(HAVE_VASPRINTF)
50+ /* CAW: compliant version of vasprintf */
51++static int vasprintf(char **buf, const char *fmt, va_list ap)
52+-static int json_vasprintf(char **buf, const char *fmt, va_list ap)
53+ {
54+ #ifndef WIN32
55+ static char _T_emptybuffer = '\0';
56+@@ -40,5 +41,6 @@
57+
58+ return chars;
59+ }
60++#endif /* !HAVE_VASPRINTF */
61+
62+ #endif /* __vasprintf_compat_h */