rpmbuild won't segfault when %including spec with zero size
authorJindrich Novy <jnovy@redhat.com>
Wed, 12 Aug 2009 14:06:08 +0000 (16:06 +0200)
committerJindrich Novy <jnovy@redhat.com>
Wed, 12 Aug 2009 14:06:08 +0000 (16:06 +0200)
build/parseSpec.c

index 168370c..8eca502 100644 (file)
@@ -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';