- Notifications
You must be signed in to change notification settings - Fork5
Commit82bbb60
committed
Fix valgrind warning for btree_gist indexes on macaddr.
The macaddr opclass stores two macaddr structs (each of size 6) in anindex column that's declared as being of type gbtreekey16, ie 16 bytes.In the original coding this led to passing a palloc'd value of size 12to the index insertion code, so that data would be fetched past theend of the allocated value during index tuple construction. This makesvalgrind unhappy. In principle it could result in a SIGSEGV, thoughwith the current implementation of palloc there's no risk sincethe 12-byte request size would be rounded up to 16 bytes anyway.To fix, add a field to struct gbtree_ninfo showing the declared size ofthe index datums, and use that in the palloc requests; and use palloc0to be sure that any wasted bytes are cleanly initialized.Per report from Andres Freund. No back-patch since there's no currentrisk of a real problem.1 parentd900e19 commit82bbb60
File tree
15 files changed
+22
-4
lines changed- contrib/btree_gist
15 files changed
+22
-4
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
96 | 96 |
| |
97 | 97 |
| |
98 | 98 |
| |
| 99 | + | |
99 | 100 |
| |
100 | 101 |
| |
101 | 102 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
| 88 | + | |
88 | 89 |
| |
89 | 90 |
| |
90 | 91 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
80 | 81 |
| |
81 | 82 |
| |
82 | 83 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| 81 | + | |
81 | 82 |
| |
82 | 83 |
| |
83 | 84 |
| |
|
Lines changed: 4 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
87 | 87 |
| |
88 | 88 |
| |
89 | 89 |
| |
90 |
| - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
91 | 93 |
| |
92 | 94 |
| |
93 | 95 |
| |
94 | 96 |
| |
95 | 97 |
| |
96 | 98 |
| |
97 | 99 |
| |
| 100 | + | |
98 | 101 |
| |
99 | 102 |
| |
100 | 103 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
74 | 74 |
| |
75 | 75 |
| |
76 | 76 |
| |
| 77 | + | |
77 | 78 |
| |
78 | 79 |
| |
79 | 80 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
| 87 | + | |
87 | 88 |
| |
88 | 89 |
| |
89 | 90 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
124 | 124 |
| |
125 | 125 |
| |
126 | 126 |
| |
| 127 | + | |
127 | 128 |
| |
128 | 129 |
| |
129 | 130 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
127 | 127 |
| |
128 | 128 |
| |
129 | 129 |
| |
| 130 | + | |
130 | 131 |
| |
131 | 132 |
| |
132 | 133 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
| 31 | + | |
32 | 32 |
| |
33 | 33 |
| |
34 | 34 |
| |
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
| 80 | + | |
| 81 | + | |
80 | 82 |
| |
81 | 83 |
| |
82 | 84 |
| |
| |||
165 | 167 |
| |
166 | 168 |
| |
167 | 169 |
| |
168 |
| - | |
| 170 | + | |
169 | 171 |
| |
170 | 172 |
| |
171 | 173 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
40 |
| - | |
| 40 | + | |
| 41 | + | |
41 | 42 |
| |
42 | 43 |
| |
43 | 44 |
| |
|
0 commit comments
Comments
(0)