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

Commit4eadf2d

Browse files
committed
More autosize structure error checks.
1 parent37e8621 commit4eadf2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/storage/buffer/buf_init.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* 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 $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -136,7 +136,10 @@ InitBufferPool(IPCKey key)
136136
inti;
137137

138138
/* check padding of BufferDesc and BufferHdr */
139-
if (sizeof(structsbufdesc)!=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(structsbufdesc)!=PADDED_SBUFDESC_SIZE||
142+
sizeof(structsbufdesc_padded)>PADDED_SBUFDESC_SIZE)
140143
elog(WARN,"Internal error: sbufdesc does not have the proper size, "
141144
"contact the Postgres developers");
142145
if (sizeof(structsbufdesc_unpadded) <=PADDED_SBUFDESC_SIZE/2)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp