From 9f1edc04f719e2f3d1504af6fc535a93e59053c5 Mon Sep 17 00:00:00 2001 From: christos Date: Tue, 3 Jun 2008 13:02:28 +0000 Subject: [PATCH] PR/38840: Pierre Pronchery: make crashes while parsing long lines in Makefiles --- usr.bin/make/parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 8501c7038ac8..2fc4d45c9c5f 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.145 2008/02/15 21:29:50 christos Exp $ */ +/* $NetBSD: parse.c,v 1.146 2008/06/03 13:02:28 christos Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.145 2008/02/15 21:29:50 christos Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.146 2008/06/03 13:02:28 christos Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.145 2008/02/15 21:29:50 christos Exp $"); +__RCSID("$NetBSD: parse.c,v 1.146 2008/06/03 13:02:28 christos Exp $"); #endif #endif /* not lint */ #endif @@ -2193,6 +2193,7 @@ ParseGetLine(int flags, int *length) if (len <= 0) { /* We need a bigger buffer to hold this line */ tp = erealloc(cf->P_str, cf->P_buflen + IFILE_BUFLEN); + cf->P_ptr = cf->P_ptr - cf->P_str + tp; cf->P_end = cf->P_end - cf->P_str + tp; ptr = ptr - cf->P_str + tp; line = line - cf->P_str + tp;