mirror of
https://github.com/postgres/postgres.git
synced 2026-05-21 01:37:50 -04:00
Use palloc_array() in a few more places to avoid overflow
These could overflow on 32-bit systems. Backpatch-through: 14 Security: CVE-2026-6473
This commit is contained in:
parent
6f0bff33d7
commit
e42598a41e
2 changed files with 2 additions and 2 deletions
|
|
@ -118,7 +118,7 @@ plperl_to_hstore(PG_FUNCTION_ARGS)
|
|||
|
||||
pcount = hv_iterinit(hv);
|
||||
|
||||
pairs = palloc(pcount * sizeof(Pairs));
|
||||
pairs = palloc_array(Pairs, pcount);
|
||||
|
||||
i = 0;
|
||||
while ((he = hv_iternext(hv)))
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ plpython_to_hstore(PG_FUNCTION_ARGS)
|
|||
Py_ssize_t i;
|
||||
Pairs *pairs;
|
||||
|
||||
pairs = palloc(pcount * sizeof(*pairs));
|
||||
pairs = palloc_array(Pairs, pcount);
|
||||
|
||||
for (i = 0; i < pcount; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue