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