Replace a few strncmp() calls with strlcpy().

Noah Misch <noah@leadboat.com>

Commit: fb2aece8ae4e6f23310d7c87c7da3fec6f5df3a1
Author: Noah Misch <noah@leadboat.com>
Date: 2014-08-19T02:59:31Z
Releases: 9.5.0
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

Files