Re: branch-1_4 allocation overflow

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
Eric Blake <ebb9 <at> byu.net> writes:

> 2006-10-25  Eric Blake  <ebb9 <at> byu.net>
> 
> 	* src/output.c (make_diversion): Avoid size_t overflow.
> 	* doc/m4.texinfo (Diversions): Test this fix.
> 	* src/input.c (input_block): Remove unused member.  Reduce size
> 	of struct.
> 	(push_file, pop_input): Avoid useless assignment.

Oops, those changes to input.c were not only unrelated to the size_t overflow 
issue, but they were incomplete.  This removes additional dead code; together, 
both patches clean up some fallout of things rendered unnecessary by the 
location tracking overhaul.

2006-10-26  Eric Blake  <[email protected]>

	* src/input.c (pop_input): Remove unnecessary code.

Index: src/input.c
===================================================================
RCS file: /sources/m4/m4/src/Attic/input.c,v
retrieving revision 1.1.1.1.2.29
diff -u -r1.1.1.1.2.29 input.c
--- src/input.c	26 Oct 2006 04:45:31 -0000	1.1.1.1.2.29
+++ src/input.c	26 Oct 2006 14:50:26 -0000
@@ -353,21 +353,6 @@
 	  retcode = EXIT_FAILURE;
 	}
       start_of_input_line = isp->u.u_f.advance_line;
-      if (tmp == NULL)
-	{
-	  /* We have exhausted the current input stack.  However,
-	     freeing the obstack now is a bad idea, since if we are in
-	     the middle of a quote, comment, dnl, or argument
-	     collection, there is still a pointer to the former
-	     current_file that we must not invalidate until after the
-	     warning message has been issued.  Setting next to a
-	     non-string is safe in this case, because the only place
-	     more input could come from is another push_file or
-	     pop_wrapup, both of which then free the input_block.  */
-	  next = isp;
-	  isp = NULL;
-	  return;
-	}
       output_current_line = -1;
       break;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.