summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure5
-rw-r--r--configure.in4
-rw-r--r--src/funcs.c14
-rw-r--r--src/patchlevel.h7
5 files changed, 25 insertions, 8 deletions
diff --git a/config.h.in b/config.h.in
index f72087bb..80883552 100644
--- a/config.h.in
+++ b/config.h.in
@@ -27,6 +27,9 @@
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
/* Define to 1 if you have the <locale.h> header file. */
#undef HAVE_LOCALE_H
diff --git a/configure b/configure
index 2aa3d05e..914cb125 100755
--- a/configure
+++ b/configure
@@ -1808,7 +1808,7 @@ fi
# Define the identity of the package.
PACKAGE=file
- VERSION=4.20
+ VERSION=4.21
cat >>confdefs.h <<_ACEOF
@@ -20670,7 +20670,8 @@ done
-for ac_header in utime.h wchar.h wctype.h
+
+for ac_header in utime.h wchar.h wctype.h limits.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
if eval "test \"\${$as_ac_Header+set}\" = set"; then
diff --git a/configure.in b/configure.in
index df4ca298..189edbd7 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT
AC_CONFIG_SRCDIR([src/file.c])
-AM_INIT_AUTOMAKE(file, 4.20)
+AM_INIT_AUTOMAKE(file, 4.21)
AM_CONFIG_HEADER([config.h])
AM_MAINTAINER_MODE
@@ -80,7 +80,7 @@ AC_HEADER_MAJOR
AC_HEADER_SYS_WAIT
AC_HEADER_STDINT
AC_CHECK_HEADERS(fcntl.h locale.h stdint.h inttypes.h unistd.h getopt.h)
-AC_CHECK_HEADERS(utime.h wchar.h wctype.h)
+AC_CHECK_HEADERS(utime.h wchar.h wctype.h limits.h)
AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
dnl Checks for typedefs, structures, and compiler characteristics.
diff --git a/src/funcs.c b/src/funcs.c
index 93f7876d..55ac6b21 100644
--- a/src/funcs.c
+++ b/src/funcs.c
@@ -36,9 +36,19 @@
#if defined(HAVE_WCTYPE_H)
#include <wctype.h>
#endif
+#if defined(HAVE_LIMITS_H)
+#include <limits.h>
+#endif
+#ifndef SIZE_T_MAX
+#ifdef __LP64__
+#define SIZE_T_MAX (size_t)0xfffffffffffffffffU
+#else
+#define SIZE_T_MAX (size_t)0xffffffffU
+#endif
+#endif
#ifndef lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.30 2007/03/25 21:46:52 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.31 2007/05/24 12:29:54 christos Exp $")
#endif /* lint */
#ifndef HAVE_VSNPRINTF
@@ -247,7 +257,7 @@ file_getbuffer(struct magic_set *ms)
len = ms->o.size - ms->o.left;
/* * 4 is for octal representation, + 1 is for NUL */
if (len > (SIZE_T_MAX - 1) / 4) {
- file_oomem(ms);
+ file_oomem(ms, len);
return NULL;
}
psize = len * 4 + 1;
diff --git a/src/patchlevel.h b/src/patchlevel.h
index c05b9393..1cf84aab 100644
--- a/src/patchlevel.h
+++ b/src/patchlevel.h
@@ -1,11 +1,14 @@
#define FILE_VERSION_MAJOR 4
-#define patchlevel 20
+#define patchlevel 21
/*
* Patchlevel file for Ian Darwin's MAGIC command.
- * $File: patchlevel.h,v 1.63 2007/01/12 17:38:28 christos Exp $
+ * $File: patchlevel.h,v 1.64 2007/03/01 22:14:55 christos Exp $
*
* $Log: patchlevel.h,v $
+ * Revision 1.65 2007/05/24 17:22:27 christos
+ * Welcome to 4.21
+ *
* Revision 1.64 2007/03/01 22:14:55 christos
* welcome to 4.20
*