forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit126cdaf
committed
Don't assume GSSAPI result strings are null-terminated.
Our uses of gss_display_status() and gss_display_name() assumedthat the gss_buffer_desc strings returned by those functions arenull-terminated. It appears that they generally are, given thelack of field complaints up to now. However, the availabledocumentation does not promise this, and some man pagesfor gss_display_status() show examples that rely on thegss_buffer_desc.length field instead of expecting nulltermination. Also, we now have a report that on someimplementations, clang's address sanitizer is of the opinionthat the byte after the specified length is undefined.Hence, change the code to rely on the length field instead.This might well be cosmetic rather than fixing any real bug, butit's hard to be sure, so back-patch to all supported branches.While here, also back-patch the v12 changes that made pg_GSS_errordeal honestly with multiple messages available fromgss_display_status.Per report from Sudheer H R.Discussion:https://postgr.es/m/5372B6D4-8276-42C0-B8FB-BD0918826FC3@tekenlight.com1 parent4a05406 commit126cdaf
File tree
3 files changed
+26
-15
lines changed- src
- backend/libpq
- interfaces/libpq
3 files changed
+26
-15
lines changedLines changed: 18 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1213 | 1213 |
| |
1214 | 1214 |
| |
1215 | 1215 |
| |
| 1216 | + | |
1216 | 1217 |
| |
1217 | 1218 |
| |
1218 | 1219 |
| |
| |||
1226 | 1227 |
| |
1227 | 1228 |
| |
1228 | 1229 |
| |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
1229 | 1239 |
| |
1230 | 1240 |
| |
1231 | 1241 |
| |
| |||
1234 | 1244 |
| |
1235 | 1245 |
| |
1236 | 1246 |
| |
1237 |
| - | |
1238 |
| - | |
| 1247 | + | |
| 1248 | + | |
1239 | 1249 |
| |
1240 | 1250 |
| |
1241 | 1251 |
| |
1242 | 1252 |
| |
1243 |
| - | |
| 1253 | + | |
1244 | 1254 |
| |
1245 |
| - | |
| 1255 | + | |
1246 | 1256 |
| |
1247 | 1257 |
| |
1248 | 1258 |
| |
| |||
1269 | 1279 |
| |
1270 | 1280 |
| |
1271 | 1281 |
| |
1272 |
| - | |
| 1282 | + | |
1273 | 1283 |
| |
1274 | 1284 |
| |
1275 | 1285 |
| |
| |||
1278 | 1288 |
| |
1279 | 1289 |
| |
1280 | 1290 |
| |
1281 |
| - | |
1282 |
| - | |
| 1291 | + | |
1283 | 1292 |
| |
1284 | 1293 |
| |
1285 | 1294 |
| |
1286 |
| - | |
| 1295 | + | |
1287 | 1296 |
| |
1288 | 1297 |
| |
1289 |
| - | |
| 1298 | + | |
1290 | 1299 |
| |
1291 | 1300 |
| |
1292 | 1301 |
| |
|
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
33 |
| - | |
34 | 32 |
| |
35 | 33 |
| |
36 | 34 |
| |
| |||
43 | 41 |
| |
44 | 42 |
| |
45 | 43 |
| |
46 |
| - | |
| 44 | + | |
47 | 45 |
| |
48 | 46 |
| |
49 | 47 |
| |
50 | 48 |
| |
51 | 49 |
| |
52 |
| - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
53 | 54 |
| |
54 | 55 |
| |
55 |
| - | |
| 56 | + | |
56 | 57 |
| |
57 | 58 |
| |
58 | 59 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
| 38 | + | |
38 | 39 |
| |
39 | 40 |
| |
40 | 41 |
| |
|
0 commit comments
Comments
(0)