- Notifications
You must be signed in to change notification settings - Fork5
Commit02ac305
committed
Tweak libpq to avoid crashing due to incorrect buffer size calculation when
we are on a 64-bit machine (ie, size_t is wider than int) and someone passesin a query string that approaches or exceeds INT_MAX bytes. Also, just forparanoia's sake, guard against similar overflows in sizing the input buffer.The backend will not in the foreseeable future be prepared to send or receivestrings exceeding 1GB, so I didn't take the more invasive step of switchingall the buffer index variables from int to size_t; though someday we mightwant to do that.I have a suspicion that this is not the only such bug in libpq, but thisfix is enough to take care of the crash reported by Francisco Reyes.1 parent5914140 commit02ac305
File tree
5 files changed
+30
-25
lines changed- src/interfaces/libpq
5 files changed
+30
-25
lines changedLines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1581 | 1581 |
| |
1582 | 1582 |
| |
1583 | 1583 |
| |
1584 |
| - | |
| 1584 | + | |
| 1585 | + | |
1585 | 1586 |
| |
1586 | 1587 |
| |
1587 | 1588 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1685 | 1685 |
| |
1686 | 1686 |
| |
1687 | 1687 |
| |
1688 |
| - | |
| 1688 | + | |
| 1689 | + | |
1689 | 1690 |
| |
1690 | 1691 |
| |
1691 | 1692 |
| |
|
Lines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
27 | 27 |
| |
28 | 28 |
| |
29 | 29 |
| |
| |||
278 | 278 |
| |
279 | 279 |
| |
280 | 280 |
| |
281 |
| - | |
| 281 | + | |
282 | 282 |
| |
283 | 283 |
| |
284 | 284 |
| |
285 | 285 |
| |
286 |
| - | |
| 286 | + | |
287 | 287 |
| |
288 | 288 |
| |
289 | 289 |
| |
| |||
296 | 296 |
| |
297 | 297 |
| |
298 | 298 |
| |
299 |
| - | |
| 299 | + | |
300 | 300 |
| |
301 |
| - | |
| 301 | + | |
302 | 302 |
| |
303 | 303 |
| |
304 | 304 |
| |
| |||
314 | 314 |
| |
315 | 315 |
| |
316 | 316 |
| |
317 |
| - | |
| 317 | + | |
318 | 318 |
| |
319 |
| - | |
| 319 | + | |
320 | 320 |
| |
321 | 321 |
| |
322 | 322 |
| |
| |||
341 | 341 |
| |
342 | 342 |
| |
343 | 343 |
| |
344 |
| - | |
| 344 | + | |
345 | 345 |
| |
346 | 346 |
| |
347 | 347 |
| |
348 | 348 |
| |
349 |
| - | |
| 349 | + | |
350 | 350 |
| |
351 | 351 |
| |
352 | 352 |
| |
| |||
359 | 359 |
| |
360 | 360 |
| |
361 | 361 |
| |
362 |
| - | |
| 362 | + | |
363 | 363 |
| |
364 |
| - | |
| 364 | + | |
365 | 365 |
| |
366 | 366 |
| |
367 | 367 |
| |
| |||
377 | 377 |
| |
378 | 378 |
| |
379 | 379 |
| |
380 |
| - | |
| 380 | + | |
381 | 381 |
| |
382 |
| - | |
| 382 | + | |
383 | 383 |
| |
384 | 384 |
| |
385 | 385 |
| |
| |||
572 | 572 |
| |
573 | 573 |
| |
574 | 574 |
| |
575 |
| - | |
| 575 | + | |
576 | 576 |
| |
577 | 577 |
| |
578 | 578 |
| |
|
Lines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
115 | 115 |
| |
116 | 116 |
| |
117 | 117 |
| |
118 |
| - | |
| 118 | + | |
| 119 | + | |
119 | 120 |
| |
120 | 121 |
| |
121 | 122 |
| |
| |||
1310 | 1311 |
| |
1311 | 1312 |
| |
1312 | 1313 |
| |
1313 |
| - | |
| 1314 | + | |
| 1315 | + | |
1314 | 1316 |
| |
1315 | 1317 |
| |
1316 | 1318 |
| |
| |||
1745 | 1747 |
| |
1746 | 1748 |
| |
1747 | 1749 |
| |
1748 |
| - | |
| 1750 | + | |
| 1751 | + | |
1749 | 1752 |
| |
1750 | 1753 |
| |
1751 | 1754 |
| |
|
Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
15 |
| - | |
| 15 | + | |
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| |||
511 | 511 |
| |
512 | 512 |
| |
513 | 513 |
| |
514 |
| - | |
515 |
| - | |
| 514 | + | |
| 515 | + | |
516 | 516 |
| |
517 | 517 |
| |
518 | 518 |
| |
|
0 commit comments
Comments
(0)