提交 f4f6caa9 编写于 作者: B Bruce Momjian

Do proper testing of CIDR bits against network mask, e.g. don't allow:

	test=# select '204.248.199.1/31'::cidr;

Previous releases erroneously accepted such addresses.

WARN IN RELEASE NOTES

Kevin Brintnall
上级 050beacc
/*
* PostgreSQL type definitions for the INET and CIDR types.
*
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.53 2004/08/29 05:06:49 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.54 2004/10/08 01:10:31 momjian Exp $
*
* Jon Postel RIP 16 Oct 1998
*/
......@@ -942,7 +942,7 @@ addressOK(unsigned char *a, int bits, int family)
if (bits == maxbits)
return true;
byte = (bits + 7) / 8;
byte = bits / 8;
nbits = bits % 8;
mask = 0xff;
if (bits != 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册