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

Commit0fb9e4a

Browse files
committed
Fix uninitialized variable in dshash.c.
A bugfix for commit8c0d7ba. The codewould have crashed if hashtable->size_log2 ever had the same value ashashtable->control->size_log2 by coincidence.Per Valgrind.Author: Thomas MunroReported-By: Tomas VondraDiscussion:https://postgr.es/m/e72fb33c-4f31-f276-e972-263d9b59554d%402ndquadrant.com
1 parenta1924a4 commit0fb9e4a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

‎src/backend/lib/dshash.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ dshash_create(dsa_area *area, const dshash_parameters *params, void *arg)
249249
}
250250
hash_table->buckets=dsa_get_address(area,
251251
hash_table->control->buckets);
252+
hash_table->size_log2=hash_table->control->size_log2;
252253

253254
returnhash_table;
254255
}
@@ -280,6 +281,14 @@ dshash_attach(dsa_area *area, const dshash_parameters *params,
280281
hash_table->find_exclusively_locked= false;
281282
Assert(hash_table->control->magic==DSHASH_MAGIC);
282283

284+
/*
285+
* These will later be set to the correct values by
286+
* ensure_valid_bucket_pointers(), at which time we'll be holding a
287+
* partition lock for interlocking against concurrent resizing.
288+
*/
289+
hash_table->buckets=NULL;
290+
hash_table->size_log2=0;
291+
283292
returnhash_table;
284293
}
285294

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp