Fix segfault on %{?getncpus}, regression in 4.19.x
Commit deaebd0c89
assumed there would
always be args, but in the macro existence test none are set up.
Reported as a side-issue in https://issues.redhat.com/browse/RHEL-16557
This commit is contained in:
parent
01fb42d42c
commit
c110ad11c3
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue