]> granicus.if.org Git - postgresql/commit
Fix pnstrdup() to not memcpy() the maximum allowed length.
authorAndres Freund <andres@anarazel.de>
Mon, 9 Oct 2017 22:20:42 +0000 (15:20 -0700)
committerAndres Freund <andres@anarazel.de>
Mon, 9 Oct 2017 22:20:42 +0000 (15:20 -0700)
commit82c117cb90e6b6b79f06d61eb1ddf06e94e75b60
tree9157fe6d998ef40cadd2aa6392b42d1d7a6ba22f
parent8a241792f968ed5be6cf4d41e32c0d264f6c0c65
Fix pnstrdup() to not memcpy() the maximum allowed length.

The previous behaviour was dangerous if the length passed wasn't the
size of the underlying buffer, but the maximum size of the underlying
buffer.

Author: Andres Freund
Discussion: https://postgr.es/m/20161003215524.mwz5p45pcverrkyk@alap3.anarazel.de
src/backend/utils/mmgr/mcxt.c