diff --git a/contrib/pgcrypto/crypt-des.c b/contrib/pgcrypto/crypt-des.c index cea80b55e9..cc2e76a71f 100644 --- a/contrib/pgcrypto/crypt-des.c +++ b/contrib/pgcrypto/crypt-des.c @@ -670,7 +670,8 @@ px_crypt_des(const char *key, const char *setting) q = (uint8 *) keybuf; while (q - (uint8 *) keybuf - 8) { - if ((*q++ = *key << 1)) + *q++ = *key << 1; + if (*key != '\0') key++; } if (des_setkey((char *) keybuf))