Panu Matilainen 23ac61
commit 39800e901e2258685d1fc34e1e9a7b8a058e11ce
Panu Matilainen 23ac61
Author: Michael Schroeder <mls@suse.de>
Panu Matilainen 23ac61
Date:   Mon May 16 11:57:44 2011 +0300
Panu Matilainen 23ac61
Panu Matilainen 23ac61
    Fix segfault on build with empty %prep section
Panu Matilainen 23ac61
    
Panu Matilainen 23ac61
    Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Panu Matilainen 23ac61
Panu Matilainen 23ac61
diff --git a/build/parsePrep.c b/build/parsePrep.c
Panu Matilainen 23ac61
index c0508ec..9e61dde 100644
Panu Matilainen 23ac61
--- a/build/parsePrep.c
Panu Matilainen 23ac61
+++ b/build/parsePrep.c
Panu Matilainen 23ac61
@@ -504,7 +504,7 @@ int parsePrep(rpmSpec spec)
Panu Matilainen 23ac61
 	}
Panu Matilainen 23ac61
     }
Panu Matilainen 23ac61
 
Panu Matilainen 23ac61
-    for (ARGV_const_t lines = saveLines; *lines; lines++) {
Panu Matilainen 23ac61
+    for (ARGV_const_t lines = saveLines; lines && *lines; lines++) {
Panu Matilainen 23ac61
 	res = 0;
Panu Matilainen 23ac61
 	if (rstreqn(*lines, "%setup", sizeof("%setup")-1)) {
Panu Matilainen 23ac61
 	    res = doSetupMacro(spec, *lines);