Re: patch contrib/pgcrypto for win32 (2) - bug report - Mailing list pgsql-patches

From Tom Lane
Subject Re: patch contrib/pgcrypto for win32 (2) - bug report
Date
Msg-id 2301.1102350745@sss.pgh.pa.us
Whole thread Raw
In response to Re: patch contrib/pgcrypto for win32 (2) - bug report  ("Korea PostgreSQL Users' Group" <pgsql-kr@postgresql.or.kr>)
List pgsql-patches
"Korea PostgreSQL Users' Group" <pgsql-kr@postgresql.or.kr> writes:
> this bug is only for win32 system.
> On mingw32 random() function have to be initialized by srandom().
> so, I put srandom(time(NULL)) line.

But there is already an srandom() call during backend startup.

> Because random() function return integer (2byte), this return integer number need filtering.
> so, I changed random() % 255 line.

But the value will automatically be converted to a single byte when it's
stored into a uint8 variable.

> plz, check and properly fix this bug.

I see no bug here.

            regards, tom lane

pgsql-patches by date:

Previous
From: "Korea PostgreSQL Users' Group"
Date:
Subject: Re: patch contrib/pgcrypto for win32 (2) - bug report
Next
From: Marko Kreen
Date:
Subject: Re: patch contrib/pgcrypto for win32 (2) - bug report