Avoid returning undefined bytes in chkpass_in().

Enterprise / PostgreSQL - Tom Lane [sss.pgh.pa.us] - 14 February 2015 11:20 UTC

We can't really fix the problem that the result is defined to depend on random(), so it is still going to fail the "unstable input conversion" test in parse_type.c. However, we can at least satify valgrind. (It looks like this code used to be valgrind-clean, actually, until somebody did a careless s/strncpy/strlcpy/g on it.)

In passing, let's just make real sure that chkpass_out doesn't overrun its output buffer.

No need for backpatch, I think, since this is just to satisfy debugging tools.

Asif Naeem

80986e8 Avoid returning undefined bytes in chkpass_in().
contrib/chkpass/chkpass.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Upstream: git.postgresql.org


  • Share