util/grub-mount: Check file path sanity
PATCH 1/1 util/grub-mount: Check file path sanity
In grub-mount.c, the function argp_parser() lacks a check on the sanity of the file path when parsing parameters. This results in a segmentation fault if a partition is mounted to a non-existent path.
Signed-off-by Qiumiao Zhang <[email protected]>
--- util/grub-mount.c | 2 ++ 1 file changed, 2 insertions(+)
util/grub-mount.c +2 -0
@@ -563,6 +563,8 @@ argp_parser (int key, char *arg, struct argp_state *state) images =xrealloc (images, (num_disks +1 ) *sizeof (images[0 ])); images[num_disks] =grub_canonicalize_file_name (arg); +if (images[num_disks] ==NULL ) +grub_util_error (_ ("cannot find '%s': %s" ), arg,strerror (errno)); num_disks++;return 0 ;
Signature · 7 lines
2.28.0.windows.1 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 5 lines · Qiumiao Zhang via Grub-devel
In
grub-mount.c, the functionargp_parser()lacks a check on the sanity of the file path when parsing parameters. This results in a segmentation fault if a partition is mounted to a non-existent path.Signed-off-by Qiumiao Zhang <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Daniel
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel