diff --git a/rpmio/macro.c b/rpmio/macro.c index 8d97256e3..f01fb7d44 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -1219,7 +1219,7 @@ static unsigned long getmem_proc(int thread) static void doGetncpus(rpmMacroBuf mb, rpmMacroEntry me, ARGV_t argv, size_t *parsed) { const char *sizemacro = NULL; - const char *arg = argv[1] ? argv[1] : "total"; + const char *arg = (argv && argv[1]) ? argv[1] : "total"; char buf[32]; unsigned int ncpus = getncpus(); unsigned long mem = 0;