Skip to content
Snippets Groups Projects
  1. Feb 06, 2017
  2. Aug 31, 2016
    • Tom Lane's avatar
      Fix a bunch of places that called malloc and friends with no NULL check. · 052cc223
      Tom Lane authored
      Where possible, use palloc or pg_malloc instead; otherwise, insert
      explicit NULL checks.
      
      Generally speaking, these are places where an actual OOM is quite
      unlikely, either because they're in client programs that don't
      allocate all that much, or they're very early in process startup
      so that we'd likely have had a fork() failure instead.  Hence,
      no back-patch, even though this is nominally a bug fix.
      
      Michael Paquier, with some adjustments by me
      
      Discussion: <CAB7nPqRu07Ot6iht9i9KRfYLpDaF2ZuUv5y_+72uP23ZAGysRg@mail.gmail.com>
      052cc223
  3. Aug 15, 2015
  4. Jul 02, 2015
    • Fujii Masao's avatar
      Make use of xlog_internal.h's macros in WAL-related utilities. · fb174687
      Fujii Masao authored
      Commit 179cdd09 added macros to check if a filename is a WAL segment
      or other such file. However there were still some instances of the
      strlen + strspn combination to check for that in WAL-related utilities
      like pg_archivecleanup. Those checks can be replaced with the macros.
      
      This patch makes use of the macros in those utilities and
      which would make the code a bit easier to read.
      
      Back-patch to 9.5.
      
      Michael Paquier
      fb174687
  5. Jan 15, 2015
    • Robert Haas's avatar
      pg_standby: Avoid writing one byte beyond the end of the buffer. · 0b49642b
      Robert Haas authored
      Previously, read() might have returned a length equal to the buffer
      length, and then the subsequent store to buf[len] would write a
      zero-byte one byte past the end.  This doesn't seem likely to be
      a security issue, but there's some chance it could result in
      pg_standby misbehaving.
      
      Spotted by Coverity; patch by Michael Paquier, reviewed by me.
      0b49642b
  6. Jul 14, 2014
  7. Mar 21, 2014
  8. Feb 17, 2014
    • Tom Lane's avatar
      Prevent potential overruns of fixed-size buffers. · 01824385
      Tom Lane authored
      Coverity identified a number of places in which it couldn't prove that a
      string being copied into a fixed-size buffer would fit.  We believe that
      most, perhaps all of these are in fact safe, or are copying data that is
      coming from a trusted source so that any overrun is not really a security
      issue.  Nonetheless it seems prudent to forestall any risk by using
      strlcpy() and similar functions.
      
      Fixes by Peter Eisentraut and Jozef Mlich based on Coverity reports.
      
      In addition, fix a potential null-pointer-dereference crash in
      contrib/chkpass.  The crypt(3) function is defined to return NULL on
      failure, but chkpass.c didn't check for that before using the result.
      The main practical case in which this could be an issue is if libc is
      configured to refuse to execute unapproved hashing algorithms (e.g.,
      "FIPS mode").  This ideally should've been a separate commit, but
      since it touches code adjacent to one of the buffer overrun changes,
      I included it in this commit to avoid last-minute merge issues.
      This issue was reported by Honza Horak.
      
      Security: CVE-2014-0065 for buffer overruns, CVE-2014-0066 for crypt()
      01824385
  9. Feb 15, 2014
    • Tom Lane's avatar
      Centralize getopt-related declarations in a new header file pg_getopt.h. · 60ff2fdd
      Tom Lane authored
      We used to have externs for getopt() and its API variables scattered
      all over the place.  Now that we find we're going to need to tweak the
      variable declarations for Cygwin, it seems like a good idea to have
      just one place to tweak.
      
      In this commit, the variables are declared "#ifndef HAVE_GETOPT_H".
      That may or may not work everywhere, but we'll soon find out.
      
      Andres Freund
      60ff2fdd
  10. Nov 07, 2013
  11. May 29, 2013
  12. Mar 17, 2013
    • Tom Lane's avatar
      Use pqsignal() in contrib programs rather than calling signal(2) directly. · 3c07fbf4
      Tom Lane authored
      The semantics of signal(2) are more variable than one could wish; in
      particular, on strict-POSIX platforms the signal handler will be reset
      to SIG_DFL when the signal is delivered.  This demonstrably breaks
      pg_test_fsync's use of SIGALRM.  The other changes I made are not
      absolutely necessary today, because the called handlers all exit the
      program anyway.  But it seems like a good general practice to use
      pqsignal() exclusively in Postgres code, now that we have it available
      everywhere.
      3c07fbf4
  13. Oct 12, 2012
  14. Jun 18, 2012
  15. May 23, 2012
  16. May 20, 2012
  17. Aug 14, 2011
  18. Jun 09, 2011
  19. May 28, 2011
  20. May 12, 2011
  21. May 05, 2011
  22. Jan 25, 2011
  23. Sep 22, 2010
  24. Sep 20, 2010
  25. May 15, 2010
  26. May 12, 2010
  27. Feb 26, 2010
  28. Nov 04, 2009
  29. Jul 16, 2009
  30. Jun 25, 2009
  31. Jun 18, 2009
  32. Jun 11, 2009
  33. May 14, 2009
    • Heikki Linnakangas's avatar
      Add recovery_end_command option to recovery.conf. recovery_end_command · 9e403c25
      Heikki Linnakangas authored
      is run at the end of archive recovery, providing a chance to do external
      cleanup. Modify pg_standby so that it no longer removes the trigger file,
      that is to be done using the recovery_end_command now.
      
      Provide a "smart" failover mode in pg_standby, where we don't fail over
      immediately, but only after recovering all unapplied WAL from the archive.
      That gives you zero data loss assuming all WAL was archived before
      failover, which is what most users of pg_standby actually want.
      
      recovery_end_command by Simon Riggs, pg_standby changes by Fujii Masao and
      myself.
      9e403c25
  34. Mar 26, 2009
  35. Mar 18, 2009
  36. Feb 27, 2009
  37. Jan 06, 2009
Loading