Re: Re: bug in pgcrypto 0.3

Ian Lance Taylor <ian@airs.com>

From: Ian Lance Taylor <ian@airs.com>
To: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Marko Kreen <marko@l-t.ee>, Neil Conway <nconway@klamath.dyndns.org>, pgsql-hackers@postgresql.org
Date: 2001-05-14T20:15:59Z
Lists: pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:

> Applied to 7.1.X and 7.2.

But, but...

> > -	return srclen + (srclen / 3) + (srclen / (76 / 2));
> > +	return srclen + (srclen + 2 / 3) + (srclen / (76 / 2)) + 2;

(srclen + 2 / 3) is always the same as (srclen).

Perhaps this was meant to be ((srclen + 2) / 3)?

The current code is safe, but weird.

Ian