forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4ed22e8
committed
Check get_tle_by_resno() result before deref
When creating a sort to support a group by, we need to look up thetarget entry in the target list by the resno using get_tle_by_resno().This particular code-path didn't check the result prior to attemptingto dereference it, while all other callers did. While I can't see away for this usage of get_tle_by_resno() to fail (you can't ask fora column to be sorted on which isn't included in the group by), it'sprobably best to check that we didn't end up with a NULL somehowanyway than risk the segfault.I'm willing to back-patch this if others feel it's necessary, but myguess is new features are what might tickle this rather than anythingexisting.Missing check spotted by the Coverity scanner.1 parent4403a9d commit4ed22e8
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4188 | 4188 |
| |
4189 | 4189 |
| |
4190 | 4190 |
| |
| 4191 | + | |
| 4192 | + | |
| 4193 | + | |
4191 | 4194 |
| |
4192 | 4195 |
| |
4193 | 4196 |
| |
|
0 commit comments
Comments
(0)