]> andersk Git - splint.git/commitdiff
Fixed buffer overflow in cscanner.l
authordrl7x <drl7x>
Thu, 17 Jan 2002 06:57:52 +0000 (06:57 +0000)
committerdrl7x <drl7x>
Thu, 17 Jan 2002 06:57:52 +0000 (06:57 +0000)
18 files changed:
Makefile.am
Makefile.binary.am
Makefile.binary.in
Makefile.in
configure
configure.ac
configure.binary
configure.binary.ac
fixBinaryDist.sh
src/Headers/constants.h
src/Makefile.am
src/Makefile.in
src/cscanner.l
src/flex.head
src/flex.reset
test/Makefile
test/null6.lcd
test/tests2.5/newlint.lcd

index 9112557611f7fcb95a81e747f9cff4a0ecd5ffbe..f4ea95c122aa4c25f886ea59f0f6ede5b7f3c507 100644 (file)
@@ -29,17 +29,35 @@ AUTOMAKE_OPTIONS = 1.5 foreign
 binaryfixscript = ./fixBinaryDist.sh
 SUBDIRS =   lib imports test doc src
 
+binaryDir = bin
+binaryDirFiles =  $(binaryDir)/Makefile.am $(binaryDir)/Makefile.in
+
 binaryBuiltFiles = Makefile.binary.am configure.binary.ac
+
 #include these in case we're trying to build on a systems
 #without the bleeding edge versions of automake and autoconf
 binaryDerivedFiles = Makefile.binary.in configure.binary
 
-EXTRA_DIST = $(binaryfixscript) $(binaryBuiltFiles) $(binaryDerivedFiles) preBuilt/Makefile.am preBuilt/Makefile.in
+#try to remake these but don't stop if it fails.
+configure.binary:configure.binary.ac
+       -autoconf -oconfigure.binary configure.binary.ac
+
+Makefile.binary.in:Makefile.binary.am
+       -automake Makefile.binary
+
+$(binaryDir)/Makefile.in: $(binaryDir)/Makefile.am
+       -automake $(binaryDir)/Makefile
+
+EXTRA_DIST = $(binaryfixscript) $(binaryBuiltFiles) $(binaryDerivedFiles) $(binaryDirFiles)
+
+preDist:  $(binaryDir)/Makefile.in  $(binaryDerivedFiles) 
 
-bindist:
+bindist: $(binaryDerivedFiles) 
        $(MAKE)
-       $(CP) src/splint preBuilt/splint
-       $(MAKE) -e dist dh_script=$(binaryfixscript) SUBDIRS="preBuilt lib imports  doc"
+       $(RM) -f $(binaryDir)/splint
+       $(CP) src/splint $(binaryDir)/splint
+       $(MAKE) -e dist dh_script=$(binaryfixscript) SUBDIRS="$(binaryDir) lib imports  doc"
+       $(MV) $(distdir).tar.gz $(distdir).`uname`.tgz 
 
 dist-hook:
        cd $(distdir);  pwd; $(dh_script)
index 731b7bab82ecccfacb9535706c8251d61daad857..6392725631881a01a11392f3e333121c25e2c38b 100644 (file)
 
 AUTOMAKE_OPTIONS = 1.5 foreign
 
-SUBDIRS =  preBuilt lib imports  doc
+binaryDir = bin
+
+SUBDIRS =  $(binaryDir) lib imports  doc
+
+all: config.h src/splint
+
+src/splint: $(binaryDir)/splint
+       ln -s ../$(binaryDir)/splint src/splint
index 5eeb1c509a023f861eccbe8f5e834be9e25561ce..1ad55bf78dafc313e2a2af8684daba38cd253185 100644 (file)
@@ -87,7 +87,9 @@ install_sh = @install_sh@
 
 AUTOMAKE_OPTIONS = 1.5 foreign
 
-SUBDIRS = preBuilt lib imports  doc
+binaryDir = bin
+
+SUBDIRS = $(binaryDir) lib imports  doc
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
@@ -408,6 +410,11 @@ uninstall-info: uninstall-info-recursive
        uninstall uninstall-am uninstall-info-am \
        uninstall-info-recursive uninstall-recursive
 
+
+all: config.h src/splint
+
+src/splint: $(binaryDir)/splint
+       ln -s ../$(binaryDir)/splint src/splint
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 0db23689d24bfd2a2382a756a679dea2eb32bab8..ff515086ccca0fdd9e0e443947e4cfd6f873a1aa 100644 (file)
@@ -90,27 +90,31 @@ AUTOMAKE_OPTIONS = 1.5 foreign
 binaryfixscript = ./fixBinaryDist.sh
 SUBDIRS = lib imports test doc src
 
+binaryDir = bin
+binaryDirFiles = $(binaryDir)/Makefile.am $(binaryDir)/Makefile.in
+
 binaryBuiltFiles = Makefile.binary.am configure.binary.ac
+
 #include these in case we're trying to build on a systems
 #without the bleeding edge versions of automake and autoconf
 binaryDerivedFiles = Makefile.binary.in configure.binary
 
-EXTRA_DIST = $(binaryfixscript) $(binaryBuiltFiles) $(binaryDerivedFiles) preBuilt/Makefile.am preBuilt/Makefile.in
+EXTRA_DIST = $(binaryfixscript) $(binaryBuiltFiles) $(binaryDerivedFiles) $(binaryDirFiles)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = preBuilt/Makefile
+CONFIG_CLEAN_FILES =
 DIST_SOURCES =
 
 RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
        uninstall-info-recursive all-recursive install-data-recursive \
        install-exec-recursive installdirs-recursive install-recursive \
        uninstall-recursive check-recursive installcheck-recursive
-DIST_COMMON = README ./stamp-h.in Makefile.am Makefile.in acinclude.m4 \
-       aclocal.m4 config.hin config/config.guess config/config.sub \
-       config/depcomp config/install-sh config/missing \
-       config/mkinstalldirs configure configure.ac
+DIST_COMMON = README ./stamp-h.in ChangeLog Makefile.am Makefile.in \
+       acinclude.m4 aclocal.m4 config.hin config/config.guess \
+       config/config.sub config/depcomp config/install-sh \
+       config/missing config/mkinstalldirs configure configure.ac
 DIST_SUBDIRS = $(SUBDIRS)
 all: config.h
        $(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -156,8 +160,6 @@ $(srcdir)/./stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
 
 distclean-hdr:
        -rm -f config.h
-preBuilt/Makefile: $(top_builddir)/config.status $(top_srcdir)/preBuilt/Makefile.in
-       cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= CONFIG_LINKS= $(SHELL) ./config.status
 uninstall-info-am:
 
 # This directory's subdirectories are mostly independent; you can cd
@@ -263,7 +265,7 @@ GZIP_ENV = --best
 distdir: $(DISTFILES)
        -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
        mkdir $(distdir)
-       $(mkinstalldirs) $(distdir)/config $(distdir)/preBuilt
+       $(mkinstalldirs) $(distdir)/$(binaryDir) $(distdir)/config
        @for file in $(DISTFILES); do \
          if test -f $$file; then d=.; else d=$(srcdir); fi; \
          dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
@@ -421,10 +423,24 @@ uninstall-info: uninstall-info-recursive
        uninstall-info-recursive uninstall-recursive
 
 
-bindist:
+#try to remake these but don't stop if it fails.
+configure.binary:configure.binary.ac
+       -autoconf -oconfigure.binary configure.binary.ac
+
+Makefile.binary.in:Makefile.binary.am
+       -automake Makefile.binary
+
+$(binaryDir)/Makefile.in: $(binaryDir)/Makefile.am
+       -automake $(binaryDir)/Makefile
+
+preDist:  $(binaryDir)/Makefile.in  $(binaryDerivedFiles) 
+
+bindist: $(binaryDerivedFiles) 
        $(MAKE)
-       $(CP) src/splint preBuilt/splint
-       $(MAKE) -e dist dh_script=$(binaryfixscript) SUBDIRS="preBuilt lib imports  doc"
+       $(RM) -f $(binaryDir)/splint
+       $(CP) src/splint $(binaryDir)/splint
+       $(MAKE) -e dist dh_script=$(binaryfixscript) SUBDIRS="$(binaryDir) lib imports  doc"
+       $(MV) $(distdir).tar.gz $(distdir).`uname`.tgz 
 
 dist-hook:
        cd $(distdir);  pwd; $(dh_script)
index 5b86b6c8d3e2a888a9cbec0c3e36e288c6bd5e25..cbc09462865de7253bb89835186f4ba277a3e9fd 100755 (executable)
--- a/configure
+++ b/configure
@@ -3173,7 +3173,7 @@ cat >>confdefs.h <<EOF
 #define TARGET_OS "${target_os}"
 EOF
 
-ac_config_files="$ac_config_files Makefile imports/Makefile lib/Makefile src/Makefile test/Makefile doc/Makefile preBuilt/Makefile"
+ac_config_files="$ac_config_files Makefile imports/Makefile lib/Makefile src/Makefile test/Makefile doc/Makefile bin/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -3500,7 +3500,7 @@ do
   "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
   "test/Makefile" ) CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
-  "preBuilt/Makefile" ) CONFIG_FILES="$CONFIG_FILES preBuilt/Makefile" ;;
+  "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
   "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
   *) { { echo "$as_me:3506: error: invalid argument: $ac_config_target" >&5
index 5a0c7b5d2c30dfe27a1ff4a4d86f5022cf27af6c..9800c7112b02b49d7d18e63a78f62e54f34a4a28 100644 (file)
@@ -1,5 +1,6 @@
 dnl Process with autoconf to create a configure script  -*- Autoconf -*-
 AC_PREREQ(2.50)
+
 AC_INIT([Splint], [3.0.1.4], [splint-bug@splint.org], [splint])
 
 dnl This MUST precede any other macro
@@ -201,7 +202,7 @@ dnl                  test/tests2.2/Makefile
 dnl                  test/db1/Makefile])
 
 AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile src/Makefile
-                 test/Makefile doc/Makefile preBuilt/Makefile])
+                 test/Makefile doc/Makefile bin/Makefile])
 AC_OUTPUT 
 
 
index 7bf8c6e53e211cf6967253b85b7623c72d7a6ef5..46e0446178eb6ceb46161d91397969be47bff8e2 100755 (executable)
@@ -3173,7 +3173,7 @@ cat >>confdefs.h <<EOF
 #define TARGET_OS "${target_os}"
 EOF
 
-ac_config_files="$ac_config_files Makefile imports/Makefile lib/Makefile doc/Makefile preBuilt/Makefile"
+ac_config_files="$ac_config_files Makefile imports/Makefile lib/Makefile doc/Makefile bin/Makefile"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -3498,7 +3498,7 @@ do
   "imports/Makefile" ) CONFIG_FILES="$CONFIG_FILES imports/Makefile" ;;
   "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
   "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
-  "preBuilt/Makefile" ) CONFIG_FILES="$CONFIG_FILES preBuilt/Makefile" ;;
+  "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
   "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;;
   "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.hin" ;;
   *) { { echo "$as_me:3504: error: invalid argument: $ac_config_target" >&5
index 42a6546e52393c6db37460346d8e57eaadc750c0..9be084839c55682d5959c07f4eeb392ebeeb47fc 100644 (file)
@@ -201,7 +201,7 @@ dnl                  test/tests2.2/Makefile
 dnl                  test/db1/Makefile])
 
 AC_CONFIG_FILES([Makefile imports/Makefile lib/Makefile 
-                 doc/Makefile preBuilt/Makefile])
+                 doc/Makefile bin/Makefile])
 AC_OUTPUT 
 
 
index eebc770756b67f8225189cb064280f9e37e2d9b7..22e82f2fd64ac0a4ef85f30f9b452b28de09ec34 100755 (executable)
@@ -19,5 +19,8 @@ cp Makefile.binary.in Makefile.in
 #run these if possible...
 autoconf
 automake
-mkdir src
-ln -s ../preBuilt/splint src/splint
+mkdir src || echo "COULD NOT MAKE src tar ball may be incorrect"
+echo "Created this file because some versions of tar are too simple include this directory without it"  > src/dummy
+
+# Need to do this in the makefile because the tar command in make dist wants to derefence symlinks
+#ln -s ../bin/splint src/splint
index f8be6c78278f235971d867268a77a20ce13c0afc..8c719808414fd418ab753d26930aec0d44b7adeb 100644 (file)
@@ -70,7 +70,7 @@
 # define LIBRARY_MARKER ";;; Splint Library "
 
 /*@constant int MAX_NAME_LENGTH=256; @*/
-# define MAX_NAME_LENGTH 256
+# define MAX_NAME_LENGTH 1024
 
 /*@constant int MAX_LINE_LENGTH=1024; @*/
 # define MAX_LINE_LENGTH 1024
index 6bedab64a6c5017b46f97a8fc53f18d6657a7802..558ff8255fa8e1d9c93545a014d52fcd60218eaf 100644 (file)
@@ -251,7 +251,7 @@ COMMONSRC = $(OVERFLOWCHSRC) $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \
 ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC)
 
 #files to run Splint on
-LINTSRC = $(COMMONSRC) $(SPLINTSRC) 
+LINTSRC = $(COMMONSRC) $(SPLINTSRC)
 
 #ALLSRC = $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC)
 
@@ -382,16 +382,21 @@ splintme:
 lintbuffercheck: 
        ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(LCLSRC) -dump lclint \
                     +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \
-                    -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +arraybounds +arrayboundsread +implictconstraint -dLINTBUFFERCHECK
+                    -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +bounds +boundsread +implictconstraint -dLINTBUFFERCHECK
 
+binDir = bin
 
-all: splint$(EXEEXT)
+all: splint$(EXEEXT) ../$(top_builddir)/$(binDir)/splint$(EXEEXT)
+
+../$(top_builddir)/$(binDir)/splint$(EXEEXT):  splint$(EXEEXT)
+       -$(RM) -f $(top_builddir)/$(binDir)/splint$(EXEEXT)
+       ln -s $(top_builddir)/src/splint$(EXEEXT)  $(top_builddir)/$(binDir)/splint$(EXEEXT)
 
 up: 
        -rm cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c
        $(MAKE) clean
 
-CLEANFILES = splint$(EXEEXT)
+CLEANFILES = splint$(EXEEXT)  ../$(top_builddir)/$(binDir)/splint$(EXEEXT)
 
 .c.o:
        @echo "Compiling "$<"..."; \
index 836fdd447307f1c37046c26a4b5ed2783e1dbe19..d0a64e4f79d49517cf4ee3f4cca4fda4f9bd387b 100644 (file)
@@ -336,7 +336,7 @@ COMMONSRC = $(OVERFLOWCHSRC) $(CPPSRC) $(CSRC) $(CHECKSRC) $(GENERALSRC) \
 ALLSRC = $(GRAMSRC) $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC)
 
 #files to run Splint on
-LINTSRC = $(COMMONSRC) $(SPLINTSRC) 
+LINTSRC = $(COMMONSRC) $(SPLINTSRC)
 
 
 #ALLSRC = $(COMMONSRC) $(SPLINTSRC) $(DER_FILES) $(HEADERSRC)
@@ -358,7 +358,9 @@ BUILT_SOURCES = Headers/signature_gen.h Headers/cgrammar_tokens.h \
 
 CHECKS = $(subst .c,.check,$(splint_SOURCES))
 
-CLEANFILES = splint$(EXEEXT)
+binDir = bin
+
+CLEANFILES = splint$(EXEEXT)  ../$(top_builddir)/$(binDir)/splint$(EXEEXT)
 subdir = src
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
@@ -579,7 +581,7 @@ CCLD = $(CC)
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 CFLAGS = @CFLAGS@
 DIST_SOURCES = $(lcl_SOURCES) $(splint_SOURCES)
-DIST_COMMON = ChangeLog Makefile.am Makefile.in
+DIST_COMMON = Makefile.am Makefile.in
 SOURCES = $(lcl_SOURCES) $(splint_SOURCES)
 
 all: $(BUILT_SOURCES)
@@ -1056,9 +1058,13 @@ splintme:
 lintbuffercheck: 
        ./splint $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) +singleinclude $(LINTSRC) $(LCLSRC) -dump lclint \
                     +forcehints -misplacedsharequal +showsourceloc -unrecogcomments \
-                    -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +arraybounds +arrayboundsread +implictconstraint -dLINTBUFFERCHECK
+                    -supcounts -fcnuse -exportlocal -constuse -mts file -mts filerw +bounds +boundsread +implictconstraint -dLINTBUFFERCHECK
+
+all: splint$(EXEEXT) ../$(top_builddir)/$(binDir)/splint$(EXEEXT)
 
-all: splint$(EXEEXT)
+../$(top_builddir)/$(binDir)/splint$(EXEEXT):  splint$(EXEEXT)
+       -$(RM) -f $(top_builddir)/$(binDir)/splint$(EXEEXT)
+       ln -s $(top_builddir)/src/splint$(EXEEXT)  $(top_builddir)/$(binDir)/splint$(EXEEXT)
 
 up: 
        -rm cgrammar.c llgrammar.c mtgrammar.c signature.c cscanner.c
index 6118acac4184e4d835808183bba1bebb7b61bf35..74a3779a8a07738bac204aee20ef4c8027cea494 100644 (file)
@@ -1713,20 +1713,23 @@ static bool handleSpecial (char *yyt)
   char c;
   char *ol;
   cstring olc;
-  
-  strcpy (l, yyt + 1);
 
-  /* Need to safe original l for deallocating. */
-  ol = l;
+  int len_yyt;
+
+  len_yyt = strlen (yyt +1) ;
 
-  l += strlen (yyt) - 1;
+  l = mstring_copy (yyt + 1);
   
   while ((c = char_fromInt (lminput ())) != '\n' && c != '\0')
     {
-      *l++ = c;
+      l = mstring_append(l, c);
     }
 
-  *l = '\0';
+    /* Need to safe original l for deallocating. */
+  ol = l;
+
+  l += strlen (l);
+
   olc = cstring_fromChars (ol);
   
   if (cstring_equalPrefixLit (olc, "pragma"))
index 19b59ccca000f79bc186057635f954824faa2f59..c73de115ee3f239809be3f12564f1df64af06fb5 100644 (file)
@@ -54,8 +54,6 @@
 /*@-retvalother@*/
 
 /*drl added 11/27/2001*/
-/*@-arraybounds@*/
-/*@-arrayboundsread@*/
 
 
 # ifdef __LCLINT__
index f0b2b288f03957af2d0b57d646c5d4ac5d56c032..0ef79dec91392b7fefa6893c9209b792b7c63696 100644 (file)
 /*@=redecl@*/
 /*@=retvalother@*/
 
-
-/*drl added 11/27/2001*/
-/*@=arraybounds@*/
-/*@=arrayboundsread@*/
-
 # ifdef OSF
 # define __GNUC__
 # endif
index fe8b0b36b9c57b4f0075431c3f32c6ed20bb000f..a68f22ad77e64354e1c4d13e6310ec28afe68fd9 100644 (file)
@@ -80,7 +80,7 @@ MV = mv
 OBJEXT = o
 PACKAGE = splint
 RM = rm
-VERSION = 3.0.1.2
+VERSION = 3.0.1.4
 am__include = include
 am__quote = 
 install_sh = /net/af9/drl7x/reTmp/LCLintDev/config/install-sh
@@ -114,7 +114,7 @@ SPLINTRNEST = $(SPLINTRNNEST) -exportlocal +debugfcnconstraint
 UNITTESTS = \
   help \
   abstptr abstract alias alttypes ansireserved argorder \
-  args blocks break cases cast charlit clauses commentchar compdestroy \
+  args arraydims blocks break cases cast charlit clauses commentchar compdestroy \
   constannot controldepth csyntax czechnames czechoslovaknames deadparam \
   decl enum exports external fields flags forbody format freearray \
   funcpointer functionmacro glob globals impabstract info init inparam internal iter keep libs \
@@ -1028,6 +1028,11 @@ argorder:
 args:
        -$(SPLINTR) args -noeffect -expect 12
 
+.PHONY: arraydims
+arraydims:
+       -$(SPLINTR) arraydims.c -varuse -expect 2
+       -$(SPLINTR) arraydims.c -initsize -varuse
+
 .PHONY: blocks
 blocks:
        -$(SPLINTR) blocks.c -expect 4
index 4484442bd3905df386a40e5f9737eabd25cb2e37..cd94c56a4724a00b812d460cf3f8c3bb1bf918a9 100644 (file)
@@ -1,5 +1,5 @@
 ;;; Splint Library  null6.lcd
-;;Splint 3.0.1.2 --- 14 Jan 2002
+;;Splint 3.0.1.4 --- 17 Jan 2002
 ;;lib:298
 ;;ctTable
 0 u-2 19 38
index 07892eb264c65b3f443c932bc92d7ad5e4be6efd..72bf5aa66f7c671f2456d4e6faa5ee48fd87449c 100644 (file)
@@ -1,5 +1,5 @@
 ;;; Splint Library  newlint.lcd
-;;Splint 3.0.1.2 --- 14 Jan 2002
+;;Splint 3.0.1.4 --- 17 Jan 2002
 ;;lib:298
 ;;ctTable
 0 u-2 19 38
This page took 0.179515 seconds and 5 git commands to generate.