Don't segfault on "" rcfiles argument (spotted by Pixel)
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 19 Jan 2009 12:37:09 +0000 (14:37 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 19 Jan 2009 13:05:35 +0000 (15:05 +0200)
(cherry picked from commit 479a4a9d75a1973247f1a937228ec96479f88c31)

lib/rpmrc.c

index 797061d..eb430a4 100644 (file)
@@ -1628,7 +1628,7 @@ static rpmRC rpmReadRC(const char * rcfiles)
     argvFree(globs);
 
     /* Read each file in rcfiles. */
-    for (p = files; *p; p++) {
+    for (p = files; p && *p; p++) {
        /* XXX Only /usr/lib/rpm/rpmrc must exist in default rcfiles list */
        if (access(*p, R_OK) != 0) {
            if (rcfiles == defrcfiles && p != files)