]> granicus.if.org Git - postgresql/commit
When using C-string lookup keys in a dynahash.c hash table, use strncpy()
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Jun 2005 20:51:44 +0000 (20:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Jun 2005 20:51:44 +0000 (20:51 +0000)
commit558ff41f27da0d5a5fc9c0c9a6958bb32035b487
treeff4ec79144c85c60585d1601956dbdfe6b8376a0
parent9f64e10225e22c1fde7c001a815abe8577119541
When using C-string lookup keys in a dynahash.c hash table, use strncpy()
not memcpy() to copy the offered key into the hash table during HASH_ENTER.
This avoids possible core dump if the passed key is located very near the
end of memory.  Per report from Stefan Kaltenbrunner.
src/backend/utils/hash/dynahash.c
src/include/utils/hsearch.h