Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf4f6caa

Browse files
committed
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 NOTESKevin Brintnall
1 parent050beac commitf4f6caa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/backend/utils/adt/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
*PostgreSQL type definitions for the INET and CIDR types.
33
*
4-
*$PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.53 2004/08/29 05:06:49 momjian Exp $
4+
*$PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.54 2004/10/08 01:10:31 momjian Exp $
55
*
66
*Jon Postel RIP 16 Oct 1998
77
*/
@@ -942,7 +942,7 @@ addressOK(unsigned char *a, int bits, int family)
942942
if (bits==maxbits)
943943
return true;
944944

945-
byte=(bits+7) /8;
945+
byte=bits /8;
946946
nbits=bits %8;
947947
mask=0xff;
948948
if (bits!=0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp