mirror of
https://github.com/postgres/postgres.git
synced 2026-04-22 06:37:06 -04:00
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)
This commit is contained in:
parent
693cebff4f
commit
f0e9229058
1 changed files with 2 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* PostgreSQL type definitions for the INET and CIDR types.
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/network.c,v 1.47.2.1 2003/12/01 18:50:29 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/network.c,v 1.47.2.2 2009/10/08 04:47:06 heikki Exp $
|
||||
*
|
||||
* Jon Postel RIP 16 Oct 1998
|
||||
*/
|
||||
|
|
@ -874,7 +874,7 @@ bitncmp(void *l, void *r, int n)
|
|||
|
||||
b = n / 8;
|
||||
x = memcmp(l, r, b);
|
||||
if (x)
|
||||
if (x || (n % 8) == 0)
|
||||
return (x);
|
||||
|
||||
lb = ((const u_char *) l)[b];
|
||||
|
|
|
|||
Loading…
Reference in a new issue