]> 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:59 +0000 (20:51 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 18 Jun 2005 20:51:59 +0000 (20:51 +0000)
commit41d28499a28249549d8f589370348479ff7232af
tree9e2b1219de902ca0967887f6bea05b00cf8390c9
parent2b6dd51a5f85e904bc14f7ef00ea89fd003bdf1d
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