forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit7c41a32
committed
Fix Coverity warning about contrib/pgcrypto's mdc_finish().
Coverity points out that mdc_finish returns a pointer to a local buffer(which of course is gone as soon as the function returns), leaving opena risk of misbehaviors possibly as bad as a stack overwrite.In reality, the only possible call site is in process_data_packets()which does not examine the returned pointer at all. So there's nolive bug, but nonetheless the code is confusing and risky. Refactorto avoid the issue by letting process_data_packets() call mdc_finish()directly instead of going through the pullf_read() API.Although this is only cosmetic, it seems good to back-patch so thatthe logic in pgp-decrypt.c stays in sync across all branches.Marko Kreen1 parentda8954b commit7c41a32
1 file changed
+19
-30
lines changedLines changed: 19 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
351 | 351 |
| |
352 | 352 |
| |
353 | 353 |
| |
354 |
| - | |
355 |
| - | |
| 354 | + | |
356 | 355 |
| |
357 | 356 |
| |
358 | 357 |
| |
359 |
| - | |
| 358 | + | |
| 359 | + | |
360 | 360 |
| |
361 |
| - | |
| 361 | + | |
| 362 | + | |
362 | 363 |
| |
363 | 364 |
| |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
364 | 372 |
| |
365 |
| - | |
| 373 | + | |
366 | 374 |
| |
367 | 375 |
| |
368 | 376 |
| |
369 | 377 |
| |
370 |
| - | |
371 |
| - | |
372 |
| - | |
373 |
| - | |
374 |
| - | |
375 |
| - | |
376 |
| - | |
377 |
| - | |
378 |
| - | |
379 |
| - | |
380 |
| - | |
381 |
| - | |
| 378 | + | |
382 | 379 |
| |
383 | 380 |
| |
384 |
| - | |
385 | 381 |
| |
386 | 382 |
| |
387 | 383 |
| |
| |||
394 | 390 |
| |
395 | 391 |
| |
396 | 392 |
| |
397 |
| - | |
| 393 | + | |
398 | 394 |
| |
399 | 395 |
| |
400 | 396 |
| |
| |||
403 | 399 |
| |
404 | 400 |
| |
405 | 401 |
| |
406 |
| - | |
| 402 | + | |
407 | 403 |
| |
408 | 404 |
| |
409 | 405 |
| |
| |||
414 | 410 |
| |
415 | 411 |
| |
416 | 412 |
| |
417 |
| - | |
| 413 | + | |
418 | 414 |
| |
419 | 415 |
| |
420 |
| - | |
421 |
| - | |
422 |
| - | |
423 | 416 |
| |
424 | 417 |
| |
425 | 418 |
| |
| |||
878 | 871 |
| |
879 | 872 |
| |
880 | 873 |
| |
881 |
| - | |
882 | 874 |
| |
883 | 875 |
| |
884 | 876 |
| |
| |||
937 | 929 |
| |
938 | 930 |
| |
939 | 931 |
| |
940 |
| - | |
941 |
| - | |
942 |
| - | |
943 |
| - | |
944 |
| - | |
| 932 | + | |
| 933 | + | |
945 | 934 |
| |
946 | 935 |
| |
947 | 936 |
| |
|
0 commit comments
Comments
(0)