lib: call to 'calloc' has an allocation size of 0 bytes

w->sects = calloc(sizeof(PyObject *), w->ehdr->e_shnum);

Signed-off-by: Dmytro Shytyi <dmytro.shytyi@6wind.com>
This commit is contained in:
Dmytro Shytyi 2025-01-29 14:52:20 +01:00
parent 3f785c913d
commit 83de17ca9b
No known key found for this signature in database
GPG key ID: 718B775A0DC16C29

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;