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

Commit39586bc

Browse files
committed
Fix a second cause of undersized pallocs for btree_gist indexes on macaddr.
gbt_macad_union also allocated 12-byte structs where we really need 16.Per report from Andres Freund. No back-patch since there's no currentrisk of a real problem.
1 parent82bbb60 commit39586bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎contrib/btree_gist/btree_macaddr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ typedef struct
1212
{
1313
macaddrlower;
1414
macaddrupper;
15+
charpad[4];/* make struct size = sizeof(gbtreekey16) */
1516
}macKEY;
1617

1718
/*
@@ -143,7 +144,7 @@ Datum
143144
gbt_macad_union(PG_FUNCTION_ARGS)
144145
{
145146
GistEntryVector*entryvec= (GistEntryVector*)PG_GETARG_POINTER(0);
146-
void*out=palloc(sizeof(macKEY));
147+
void*out=palloc0(sizeof(macKEY));
147148

148149
*(int*)PG_GETARG_POINTER(1)=sizeof(macKEY);
149150
PG_RETURN_POINTER(gbt_num_union((void*)out,entryvec,&tinfo));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp