Skip to content

Fix out of bounds read when parsing fstab again.

Oxalica -- requested to merge oxalica/kpmcore:fix/fstab-parsing into master

In commit 31706cff, we try to avoid out-of-bound access. But it can still access index 3 (4-th field, mount options) when there is only 3 fields, leading to a crash.

This can happen on NixOS generated fstab file which specify swap mount as only 3 fields and works well: /var/swapfile none swap. (See: https://github.com/NixOS/nixpkgs/blob/76360c005fbc560dc1f4564a920546a9dfc27447/nixos/modules/tasks/filesystems.nix#L265)

Merge request reports