Commit 535e5ea
committed
Fix null pointer handling in array iteration
Previously, when iterating through an agtype container, the code would
access `elem->val` even when `elem` was null.
This adds a null check to set the result type to AGTV_NULL when the
element is null, preventing a potential segmentation fault.
Fixes: 4274f10 ("Added the toStringList() function (#1084)")
Found by PostgresPro.
Signed-off-by: Maksim Korotkov <m.korotkov@postgrespro.ru>1 parent 1702ae0 commit 535e5ea
1 file changed
Lines changed: 2 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7500 | 7500 | | |
7501 | 7501 | | |
7502 | 7502 | | |
| 7503 | + | |
7503 | 7504 | | |
7504 | | - | |
| 7505 | + | |
7505 | 7506 | | |
7506 | 7507 | | |
7507 | 7508 | | |
7508 | | - | |
7509 | | - | |
7510 | | - | |
7511 | | - | |
7512 | | - | |
7513 | | - | |
7514 | | - | |
7515 | | - | |
7516 | 7509 | | |
7517 | 7510 | | |
7518 | 7511 | | |
| |||
0 commit comments