forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit96d1f42
committed
Read until EOF vice stat-reported size in read_binary_file
read_binary_file(), used by SQL functions pg_read_file() and friends,uses stat to determine file length to read, when not passed an explicitlength as an argument. This is problematic, for example, if the filebeing read is a virtual file with a stat-reported length of zero.Arrange to read until EOF, or StringInfo data string lenth limit, isreached instead.Original complaint and patch by me, with significant review, corrections,advice, and code optimizations by Tom Lane. Backpatched to v11. Prior tothat only paths relative to the data and log dirs were allowed for files,so no "zero length" files were reachable anyway.Reviewed-By: Tom LaneDiscussion:https://postgr.es/m/flat/969b8d82-5bb2-5fa8-4eb1-f0e685c5d736%40joeconway.comBackpatch-through: 111 parentca5e93f commit96d1f42
File tree
2 files changed
+66
-29
lines changed- contrib/adminpack/expected
- src/backend/utils/adt
2 files changed
+66
-29
lines changedLines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
| 82 | + | |
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
| |||
108 | 108 |
| |
109 | 109 |
| |
110 | 110 |
| |
111 |
| - | |
| 111 | + | |
112 | 112 |
| |
113 | 113 |
| |
114 | 114 |
| |
|
Lines changed: 64 additions & 27 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
109 |
| - | |
| 109 | + | |
110 | 110 |
| |
111 | 111 |
| |
112 |
| - | |
113 |
| - | |
114 |
| - | |
115 |
| - | |
116 |
| - | |
117 |
| - | |
118 |
| - | |
119 |
| - | |
120 |
| - | |
121 |
| - | |
122 |
| - | |
123 |
| - | |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
| 112 | + | |
| 113 | + | |
136 | 114 |
| |
137 | 115 |
| |
138 | 116 |
| |
| |||
154 | 132 |
| |
155 | 133 |
| |
156 | 134 |
| |
157 |
| - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
158 | 170 |
| |
159 |
| - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
160 | 197 |
| |
161 | 198 |
| |
162 | 199 |
| |
|
0 commit comments
Comments
(0)