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

Commitf35aef4

Browse files
committed
Fix harmless access to uninitialized memory.
When cache invalidations arrive while ri_LoadConstraintInfo() is busyfilling a new cache entry, InvalidateConstraintCacheCallBack() comparesthe - not yet initialized - oidHashValue field with the to-be-invalidatedhash value. To fix, check whether the entry is already marked as invalid.Andres Freund
1 parent540ac7c commitf35aef4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/utils/adt/ri_triggers.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2934,7 +2934,8 @@ InvalidateConstraintCacheCallBack(Datum arg, int cacheid, uint32 hashvalue)
29342934
hash_seq_init(&status,ri_constraint_cache);
29352935
while ((hentry= (RI_ConstraintInfo*)hash_seq_search(&status))!=NULL)
29362936
{
2937-
if (hashvalue==0||hentry->oidHashValue==hashvalue)
2937+
if (hentry->valid&&
2938+
(hashvalue==0||hentry->oidHashValue==hashvalue))
29382939
hentry->valid= false;
29392940
}
29402941
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp