Commit 2aad1c8
committed
Prevent out of bound array read in date_dos2unix()
The function date_dos2unix() is called during fsck while showing
information about duplicate file names. In case the date field of a
directory entry contains the invalid value 0 for the month,
date_dos2unix would read index -1 of the day_n array.
Add a check to prevent that and also make the day_n array const on this
occasion.
Reported-by: Hanno Böck
Signed-off-by: Andreas Bombe <aeb@debian.org>1 parent 3b95786 commit 2aad1c8
1 file changed
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
229 | | - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
| |||
0 commit comments