File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/backend/storage/buffer Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.5 1997/01/23 18:14:40 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/buf_init.c,v 1.6 1997/01/25 21:01:16 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -136,7 +136,10 @@ InitBufferPool(IPCKey key)
136
136
int i ;
137
137
138
138
/* check padding of BufferDesc and BufferHdr */
139
- if (sizeof (struct sbufdesc ) != PADDED_SBUFDESC_SIZE )
139
+ /* we need both checks because a sbufdesc_padded > PADDED_SBUFDESC_SIZE
140
+ will shrink sbufdesc to the required size, which is bad */
141
+ if (sizeof (struct sbufdesc ) != PADDED_SBUFDESC_SIZE ||
142
+ sizeof (struct sbufdesc_padded ) > PADDED_SBUFDESC_SIZE )
140
143
elog (WARN ,"Internal error: sbufdesc does not have the proper size, "
141
144
"contact the Postgres developers" );
142
145
if (sizeof (struct sbufdesc_unpadded ) <= PADDED_SBUFDESC_SIZE /2 )
You can’t perform that action at this time.
0 commit comments