From 241581a93ed0591bfae162089d9e61a606201fb4 Mon Sep 17 00:00:00 2001 From: Jindrich Novy Date: Wed, 12 Aug 2009 16:06:08 +0200 Subject: rpmbuild won't segfault when %including spec with zero size --- build/parseSpec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/parseSpec.c b/build/parseSpec.c index 168370c14..8eca50254 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -129,7 +129,7 @@ static int copyNextLineFromOFI(rpmSpec spec, OFI_t *ofi) to = spec->lbufPtr ? spec->lbufPtr : spec->lbuf; from = ofi->readPtr; ch = ' '; - while (*from && ch != '\n') + while (from && *from && ch != '\n') ch = *to++ = *from++; spec->lbufPtr = to; *to++ = '\0'; -- cgit v1.2.3