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
479823a710
commit
c9447b8bd0
2 changed files with 2 additions and 2 deletions
|
|
@ -121,7 +121,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)))
|
||||
|
|
|
|||
|
|
@ -153,7 +153,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