checkout: Deal gracefully with bad input
I had a /ostree/gnomeos-3.4-i686-devel directory, and this caused ostree --repo=repo checkout gnomeos-3.5-i686-devel to segfault.
This commit is contained in:
parent
e4bc1494af
commit
4a03176489
|
|
@ -97,6 +97,13 @@ parse_commit_from_symlink (GFile *symlink,
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
target = g_file_info_get_symlink_target (file_info);
|
target = g_file_info_get_symlink_target (file_info);
|
||||||
|
if (target == NULL)
|
||||||
|
{
|
||||||
|
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||||
|
"Not a symbolic link");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
last_dash = strrchr (target, '-');
|
last_dash = strrchr (target, '-');
|
||||||
if (last_dash == NULL)
|
if (last_dash == NULL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue