rpm/rpm-4.9.0-empty-prep-crash.patch
Panu Matilainen 23ac61a41f - fix crash if prep or changelog section in spec is empty (#706959)
- fix crash on macro which undefines itself
- fix script dependency generation with file 5.07 string changes (#712251)
2011-06-10 12:32:12 +03:00

22 lines
669 B
Diff

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);