Commit 920fb05
Avoid dividing by zero when showing progress
PackageInstaller's fdcopy does not check if its `size` argument is zero
before dividing `copied` by `size`. As a result, if non-image partitions
in the installer package (typically, the ESP) contain empty files, copying
those to disk raises a ZeroDivisionError that abruptly terminates the
installation process, leaving it in an inconsistent state.
Check if `size` is different than zero, and if it is skip showing progress
(which is totally fine and desired).
Signed-off-by: NoisyCoil <[email protected]>1 parent ba7c798 commit 920fb05
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
0 commit comments