Date: Sat, 10 Aug 2013 21:31:35 +0000 (UTC) From: "Simon J. Gerraty" <sjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r254194 - in head: contrib/bmake usr.bin/bmake Message-ID: <201308102131.r7ALVZ9l090921@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sjg Date: Sat Aug 10 21:31:35 2013 New Revision: 254194 URL: http://svnweb.freebsd.org/changeset/base/254194 Log: ParseGetLine: don't treat a zero byte as end of buffer if P_end says it isn't. Consume up to next newline, and issue a parse warning. If no newline found before P_end, carry on as before. Modified: head/contrib/bmake/parse.c head/usr.bin/bmake/Makefile Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Sat Aug 10 21:13:18 2013 (r254193) +++ head/contrib/bmake/parse.c Sat Aug 10 21:31:35 2013 (r254194) @@ -2582,6 +2582,16 @@ ParseGetLine(int flags, int *length) if (cf->P_end == NULL) /* End of string (aka for loop) data */ break; + /* see if there is more we can parse */ + while (ptr++ < cf->P_end) { + if ((ch = *ptr) == '\n') { + if (ptr > line && ptr[-1] == '\\') + continue; + Parse_Error(PARSE_WARNING, + "Zero byte read from file, skipping rest of line."); + break; + } + } if (cf->nextbuf != NULL) { /* * End of this buffer; return EOF and outer logic Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Sat Aug 10 21:13:18 2013 (r254193) +++ head/usr.bin/bmake/Makefile Sat Aug 10 21:31:35 2013 (r254194) @@ -17,7 +17,7 @@ CLEANFILES+= bootstrap # $Id: Makefile,v 1.17 2013/07/30 19:13:53 sjg Exp $ # Base version on src date -MAKE_VERSION= 20130730 +MAKE_VERSION= 20130810 PROG?= ${.CURDIR:T}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308102131.r7ALVZ9l090921>