Commit 607d6ff
committed
adf_dir / adfGetRDirEnt: prevent OOM error in case of invalid linking.
The recent corrections (4cfa5f3, 1327704) allowing to read volumes
containing invalid (looping) linking might not address all the cases
(hard to predict what other tricks could have been used...).
To prevent any OOM crashes in other cases like this, an additional
mechanism is added. It limits the number of levels when traversing
directories. The AmigaOS has the limit of 256 characters for the path,
but the limit is set somewhat higher, to 512 levels (what, on valid
volumes, should never be reached). Anyway, this will prevent any
OOM crashes related to such cases.1 parent c9cdc61 commit 607d6ff
1 file changed
Lines changed: 28 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
148 | | - | |
| 150 | + | |
149 | 151 | | |
150 | 152 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
154 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
155 | 166 | | |
156 | 167 | | |
157 | 168 | | |
| |||
192 | 203 | | |
193 | 204 | | |
194 | 205 | | |
195 | | - | |
196 | | - | |
| 206 | + | |
| 207 | + | |
197 | 208 | | |
198 | 209 | | |
199 | 210 | | |
| |||
258 | 269 | | |
259 | 270 | | |
260 | 271 | | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
261 | 283 | | |
262 | 284 | | |
263 | 285 | | |
| |||
0 commit comments