summaryrefslogtreecommitdiffstats
path: root/lib/compat
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compat')
-rw-r--r--lib/compat/Makefile.in7
-rw-r--r--lib/compat/strnlen.c2
-rw-r--r--lib/compat/vasprintf.c6
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/compat/Makefile.in b/lib/compat/Makefile.in
index 9b3c41c..3f3ccbb 100644
--- a/lib/compat/Makefile.in
+++ b/lib/compat/Makefile.in
@@ -105,8 +105,8 @@ host_triplet = @host@
@HAVE_UNSETENV_FALSE@am__append_15 = unsetenv.c
subdir = lib/compat
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/dpkg-arch.m4 \
- $(top_srcdir)/m4/dpkg-build.m4 \
+am__aclocal_m4_deps = $(top_srcdir)/m4/build-to-host.m4 \
+ $(top_srcdir)/m4/dpkg-arch.m4 $(top_srcdir)/m4/dpkg-build.m4 \
$(top_srcdir)/m4/dpkg-compiler.m4 \
$(top_srcdir)/m4/dpkg-coverage.m4 \
$(top_srcdir)/m4/dpkg-funcs.m4 \
@@ -353,6 +353,7 @@ PACKAGE_RELEASE_DATE = @PACKAGE_RELEASE_DATE@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VCS_ID = @PACKAGE_VCS_ID@
PACKAGE_VCS_TYPE = @PACKAGE_VCS_TYPE@
PACKAGE_VCS_URL = @PACKAGE_VCS_URL@
PACKAGE_VCS_WEB = @PACKAGE_VCS_WEB@
@@ -434,6 +435,8 @@ install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
+localedir_c = @localedir_c@
+localedir_c_make = @localedir_c_make@
localstatedir = @localstatedir@
logdir = @logdir@
mandir = @mandir@
diff --git a/lib/compat/strnlen.c b/lib/compat/strnlen.c
index d02bb4b..288a298 100644
--- a/lib/compat/strnlen.c
+++ b/lib/compat/strnlen.c
@@ -20,6 +20,8 @@
# include <config.h>
#endif
+#include <string.h>
+
#include "compat.h"
/* Find the length of STRING, but scan at most MAXLEN characters.
diff --git a/lib/compat/vasprintf.c b/lib/compat/vasprintf.c
index 9d53a32..b5a2783 100644
--- a/lib/compat/vasprintf.c
+++ b/lib/compat/vasprintf.c
@@ -19,6 +19,8 @@
#include <config.h>
+#include <errno.h>
+#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
@@ -36,7 +38,9 @@ vasprintf(char **strp, char const *fmt, va_list args)
needed = vsnprintf(NULL, 0, fmt, args_copy);
va_end(args_copy);
- if (needed < 0) {
+ if (needed < 0 || needed >= INT_MAX) {
+ if (needed >= INT_MAX)
+ errno = EOVERFLOW;
*strp = NULL;
return -1;
}