]> 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:30 +0000 (20:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Jun 2005 20:51:30 +0000 (20:51 +0000)
commit6a6f2d91d4e90d09d3b1606cc806f78944c235b3
tree92f8948eda0f91354ef40e976e3ddbcbf68a372d
parenta8d1075f271458960da683e8ec28f5a656984159
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