- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitf45bdb1
committed
Avoid possibly-theoretical OOM crash hazard in hash_create().
One place in hash_create() used DynaHashAlloc() as a convenientshorthand for MemoryContextAlloc(). That was fine when it waswritten, but it stopped being fine when9c911ec changedDynaHashAlloc() to use MCXT_ALLOC_NO_OOM (mea culpa). Changethe code to call plain MemoryContextAlloc() as intended.I think that this bug may be unreachable in practice, since we nowalways create AllocSets with some space already allocated, so thatan OOM failure here for a non-shared hash table should be impossible(with a hash table name of reasonable length anyway). And therearen't enough shared hash tables to make a crash for one of thoseprobable. Nonetheless it's clearly not operating as designed, soback-patch to v16 where9c911ec came in.Reported-by: Maksim Korotkov <m.korotkov@postgrespro.ru>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/219bdccd460510efaccf90b57e5e5ef2@postgrespro.ruBackpatch-through: 161 parent0de091a commitf45bdb1
1 file changed
+2
-1
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
388 | 388 |
| |
389 | 389 |
| |
390 | 390 |
| |
391 |
| - | |
| 391 | + | |
| 392 | + | |
392 | 393 |
| |
393 | 394 |
| |
394 | 395 |
| |
|
0 commit comments
Comments
(0)