forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8285b48
committed
Fix potential NULL pointer dereference in getIdentitySequence()
The function invokes SearchSysCacheAttNum() and SearchSysCacheAttName().They may respectively return 0 for the attribute number or NULL forthe attribute name if the attribute does not exist, without any kind oferror handling. The common practice is to check that the data retrievedfrom the syscache is valid. There is no risk of NULL pointerdereferences currently, but let's stick to the practice of making surethat this data is always valid, to catch future inconsistency mistakes.The code is switched to use get_attnum() and get_attname(), and addssome error handling.Oversight in5091995.Reported-by: Ranier VilelaAuthor: Ashutosh BapatDiscussion:https://postgr.es/m/CAEudQAqh_RZqoFcYKso5d9VhF-Vd64_ZodfQ_2zSusszkEmyRg@mail.gmail.com1 parent945ec4c commit8285b48
1 file changed
+7
-13
lines changedLines changed: 7 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
945 | 945 |
| |
946 | 946 |
| |
947 | 947 |
| |
948 |
| - | |
| 948 | + | |
949 | 949 |
| |
950 | 950 |
| |
951 | 951 |
| |
| |||
954 | 954 |
| |
955 | 955 |
| |
956 | 956 |
| |
957 |
| - | |
958 |
| - | |
959 |
| - | |
960 |
| - | |
961 |
| - | |
| 957 | + | |
| 958 | + | |
962 | 959 |
| |
963 | 960 |
| |
964 |
| - | |
965 |
| - | |
966 |
| - | |
967 |
| - | |
968 |
| - | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
969 | 965 |
| |
970 | 966 |
| |
971 |
| - | |
972 |
| - | |
973 | 967 |
| |
974 | 968 |
| |
975 | 969 |
| |
|
0 commit comments
Comments
(0)