]> granicus.if.org Git - postgresql/commit
Replace a few strncmp() calls with strlcpy().
authorNoah Misch <noah@leadboat.com>
Tue, 19 Aug 2014 02:59:31 +0000 (22:59 -0400)
committerNoah Misch <noah@leadboat.com>
Tue, 19 Aug 2014 02:59:31 +0000 (22:59 -0400)
commitfb2aece8ae4e6f23310d7c87c7da3fec6f5df3a1
tree78dfd07962f4a43f8b23ad8613441a3a018236a5
parent7fc5f1a3550ca9395051b592df150de79804131a
Replace a few strncmp() calls with strlcpy().

strncmp() is a specialized API unsuited for routine copying into
fixed-size buffers.  On a system where the length of a single filename
can exceed MAXPGPATH, the pg_archivecleanup change prevents a simple
crash in the subsequent strlen().  Few filesystems support names that
long, and calling pg_archivecleanup with untrusted input is still not a
credible use case.  Therefore, no back-patch.

David Rowley
contrib/pg_archivecleanup/pg_archivecleanup.c
src/backend/access/transam/xlogarchive.c