svn commit: r216707 - head/bin/sh

Jilles Tjoelker jilles at FreeBSD.org
Sun Dec 26 13:41:54 UTC 2010


Author: jilles
Date: Sun Dec 26 13:41:53 2010
New Revision: 216707
URL: http://svn.freebsd.org/changeset/base/216707

Log:
  sh: Fix integer overflow check, it checked an uninitialized variable.

Modified:
  head/bin/sh/memalloc.c

Modified: head/bin/sh/memalloc.c
==============================================================================
--- head/bin/sh/memalloc.c	Sun Dec 26 13:25:47 2010	(r216706)
+++ head/bin/sh/memalloc.c	Sun Dec 26 13:41:53 2010	(r216707)
@@ -231,7 +231,7 @@ growstackblock(int min)
 
 	if (min < stacknleft)
 		min = stacknleft;
-	if (newlen >= INT_MAX / 2 - ALIGN(sizeof(struct stack_block)))
+	if (min >= INT_MAX / 2 - ALIGN(sizeof(struct stack_block)))
 		error("Out of space");
 	min += stacknleft;
 	min += ALIGN(sizeof(struct stack_block));


More information about the svn-src-all mailing list