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

Commiteab94d8

Browse files
committed
Fix off-by-one bug in bitncmp(): When comparing a number of bits divisible by
8, bitncmp() may dereference a pointer one byte out of bounds.Chris Mikkelson (bug #5101)
1 parent822b015 commiteab94d8

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.74 2009/06/11 14:49:03 momjian Exp $
4+
*$PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.75 2009/10/08 04:46:21 heikki Exp $
55
*
66
*Jon Postel RIP 16 Oct 1998
77
*/
@@ -972,7 +972,7 @@ bitncmp(void *l, void *r, int n)
972972

973973
b=n /8;
974974
x=memcmp(l,r,b);
975-
if (x)
975+
if (x|| (n %8)==0)
976976
returnx;
977977

978978
lb= ((constu_char*)l)[b];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp