main: fix segfault if no mountpoint specified

Closes: https://github.com/containers/fuse-overlayfs/issues/225

Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
This commit is contained in:
Giuseppe Scrivano 2020-07-17 23:38:52 +02:00
parent fb8b3e03ca
commit 8f666d4820
No known key found for this signature in database
GPG Key ID: 67E38F7A8BA21772

3
main.c
View File

@ -5151,6 +5151,9 @@ main (int argc, char *argv[])
if (lo.redirect_dir && strcmp (lo.redirect_dir, "off")) if (lo.redirect_dir && strcmp (lo.redirect_dir, "off"))
error (EXIT_FAILURE, 0, "fuse-overlayfs only supports redirect_dir=off"); error (EXIT_FAILURE, 0, "fuse-overlayfs only supports redirect_dir=off");
if (lo.mountpoint == NULL)
error (EXIT_FAILURE, 0, "no mountpoint specified");
if (lo.upperdir != NULL) if (lo.upperdir != NULL)
{ {
cleanup_free char *full_path = NULL; cleanup_free char *full_path = NULL;