Merge pull request #17986 from dmytroshytyi-6WIND/fix-static-30-01-2025

lib: fix static analysis error
This commit is contained in:
Donatas Abraitis 2025-03-21 12:19:50 +02:00 committed by GitHub
commit 797e051222
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1306,8 +1306,8 @@ static PyObject *elffile_load(PyTypeObject *type, PyObject *args,
}
}
#endif
w->sects = calloc(w->ehdr->e_shnum, sizeof(PyObject *));
if (w->ehdr->e_shnum > 0)
w->sects = calloc(w->ehdr->e_shnum, sizeof(PyObject *));
w->n_sect = w->ehdr->e_shnum;
return (PyObject *)w;