Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

nodeHash.c

Blame
    • Tom Lane's avatar
      691c5ebf
      Add defenses against integer overflow in dynahash numbuckets calculations. · 691c5ebf
      Tom Lane authored
      The dynahash code requires the number of buckets in a hash table to fit
      in an int; but since we calculate the desired hash table size dynamically,
      there are various scenarios where we might calculate too large a value.
      The resulting overflow can lead to infinite loops, division-by-zero
      crashes, etc.  I (tgl) had previously installed some defenses against that
      in commit 299d1716, but that covered only one
      call path.  Moreover it worked by limiting the request size to work_mem,
      but in a 64-bit machine it's possible to set work_mem high enough that the
      problem appears anyway.  So let's fix the problem at the root by installing
      limits in the dynahash.c functions themselves.
      
      Trouble report and patch by Jeff Davis.
      691c5ebf
      History
      Add defenses against integer overflow in dynahash numbuckets calculations.
      Tom Lane authored
      The dynahash code requires the number of buckets in a hash table to fit
      in an int; but since we calculate the desired hash table size dynamically,
      there are various scenarios where we might calculate too large a value.
      The resulting overflow can lead to infinite loops, division-by-zero
      crashes, etc.  I (tgl) had previously installed some defenses against that
      in commit 299d1716, but that covered only one
      call path.  Moreover it worked by limiting the request size to work_mem,
      but in a 64-bit machine it's possible to set work_mem high enough that the
      problem appears anyway.  So let's fix the problem at the root by installing
      limits in the dynahash.c functions themselves.
      
      Trouble report and patch by Jeff Davis.