8, bitncmp() may dereference a pointer one byte out of bounds.
Chris Mikkelson (bug #5101)
/*
* PostgreSQL type definitions for the INET and CIDR types.
*
- * $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.74 2009/06/11 14:49:03 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/network.c,v 1.75 2009/10/08 04:46:21 heikki Exp $
*
* Jon Postel RIP 16 Oct 1998
*/
b = n / 8;
x = memcmp(l, r, b);
- if (x)
+ if (x || (n % 8) == 0)
return x;
lb = ((const u_char *) l)[b];