Fix misuse of memcpy() in check_ip().
Fix misuse of memcpy() in check_ip().

The previous coding copied garbage into a local variable, pretty much
ensuring that the intended test of an IPv6 connection address against a
promoted IPv4 address from pg_hba.conf would never match.  The lack of
field complaints likely indicates that nobody realized this was supposed
to work, which is unsurprising considering that no user-facing docs suggest
it should work.

In principle this could have led to a SIGSEGV due to reading off the end of
memory, but since the source address would have pointed to somewhere in the
function's stack frame, that's quite unlikely.  What led to discovery of
the bug is Hugo Osvaldo Barrera's report of a crash after an OS upgrade,
which is probably because he is now running a system in which memcpy raises
abort() upon detecting overlapping source and destination areas.  (You'd
have to additionally suppose some things about the stack frame layout to
arrive at this conclusion, but it seems plausible.)

This has been broken since the code was added, in commit f3aec2c7f51904e7,
so back-patch to all supported branches.

jmcatamney/gpdb,50wu/gpdb,adam8157/gpdb,ashwinstar/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,ashwinstar/gpdb,lisakowen/gpdb,adam8157/gpdb,50wu/gpdb,lisakowen/gpdb,adam8157/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,50wu/gpdb,adam8157/gpdb,adam8157/gpdb,lisakowen/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,greenplum-db/gpdb,adam8157/gpdb,xinzweb/gpdb,lisakowen/gpdb,lisakowen/gpdb,xinzweb/gpdb,50wu/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,greenplum-db/gpdb,adam8157/gpdb,jmcatamney/gpdb,lisakowen/gpdb,jmcatamney/gpdb,xinzweb/gpdb,greenplum-db/gpdb,lisakowen/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,lisakowen/gpdb,greenplum-db/gpdb,xinzweb/gpdb,xinzweb/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,50wu/gpdb,xinzweb/gpdb