Fix combo_decrypt() to throw an error for zero-length input when using a
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Aug 2007 16:16:27 +0000 (16:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Aug 2007 16:16:27 +0000 (16:16 +0000)
commit4f687f5dad978d257007f13d0c4b88bc4656d317
tree77a634dc843b3cf1bfb042961441173b75137c38
parentb4b56b5e2e7c0d9605eda939a6824355dd142fbe
Fix combo_decrypt() to throw an error for zero-length input when using a
padded encryption scheme.  Formerly it would try to access res[(unsigned) -1],
which resulted in core dumps on 64-bit machines, and was certainly trouble
waiting to happen on 32-bit machines (though in at least the known case
it was harmless because that byte would be overwritten after return).
Per report from Ken Colson; fix by Marko Kreen.
contrib/pgcrypto/px.c