- Notifications
You must be signed in to change notification settings - Fork5
Commit0e924c0
committed
Fix lo_read, lo_write, lo_truncate to cope with "size_t" length parameters.
libpq defines these functions as accepting "size_t" lengths ... but theunderlying backend functions expect signed int32 length parameters, and sowill misinterpret any value exceeding INT_MAX. Fix the libpq side to throwerror rather than possibly doing something unexpected.This is a bug of long standing, but I doubt it's worth back-patching. Theproblem is really pretty academic anyway with lo_read/lo_write, since anycaller expecting sane behavior would have to have provided a multi-gigabytebuffer. It's slightly more pressing with lo_truncate, but still we haven'tsupported large objects over 2GB until now.1 parentb6d4522 commit0e924c0
2 files changed
+90
-16
lines changedLines changed: 45 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
72 | 83 |
| |
73 | 84 |
| |
74 | 85 |
| |
| |||
299 | 310 |
| |
300 | 311 |
| |
301 | 312 |
| |
302 |
| - | |
303 |
| - | |
304 |
| - | |
305 |
| - | |
306 |
| - | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
307 | 326 |
| |
308 | 327 |
| |
309 | 328 |
| |
| |||
316 | 335 |
| |
317 | 336 |
| |
318 | 337 |
| |
319 |
| - | |
320 |
| - | |
321 |
| - | |
322 |
| - | |
323 |
| - | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
324 | 345 |
| |
325 | 346 |
| |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
326 | 354 |
| |
327 | 355 |
| |
328 | 356 |
| |
| |||
416 | 444 |
| |
417 | 445 |
| |
418 | 446 |
| |
419 |
| - | |
| 447 | + | |
420 | 448 |
| |
421 | 449 |
| |
422 | 450 |
| |
| |||
426 | 454 |
| |
427 | 455 |
| |
428 | 456 |
| |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
429 | 463 |
| |
430 | 464 |
| |
431 | 465 |
| |
|
Lines changed: 45 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
31 | 31 |
| |
32 | 32 |
| |
33 | 33 |
| |
| 34 | + | |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
| |||
155 | 156 |
| |
156 | 157 |
| |
157 | 158 |
| |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
158 | 175 |
| |
159 | 176 |
| |
160 | 177 |
| |
161 | 178 |
| |
162 | 179 |
| |
163 | 180 |
| |
164 |
| - | |
| 181 | + | |
165 | 182 |
| |
166 | 183 |
| |
167 | 184 |
| |
| |||
251 | 268 |
| |
252 | 269 |
| |
253 | 270 |
| |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
254 | 284 |
| |
255 | 285 |
| |
256 | 286 |
| |
257 | 287 |
| |
258 | 288 |
| |
259 | 289 |
| |
260 |
| - | |
| 290 | + | |
261 | 291 |
| |
262 | 292 |
| |
263 | 293 |
| |
| |||
293 | 323 |
| |
294 | 324 |
| |
295 | 325 |
| |
296 |
| - | |
297 |
| - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
298 | 338 |
| |
299 | 339 |
| |
300 | 340 |
| |
301 | 341 |
| |
302 | 342 |
| |
303 | 343 |
| |
304 |
| - | |
| 344 | + | |
305 | 345 |
| |
306 | 346 |
| |
307 | 347 |
| |
|
0 commit comments
Comments
(0)