mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-22 15:19:16 +02:00
gio: check the given child name is not an absolute path
As this would have undesirable consequence. Quoting Philip Withnall: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2305#note_1294729: The documentation never said anything about accepting absolute paths, so any code which is relying on that is relying on undocumented behaviour. We’re allowed to change that. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
parent
1df7c2ea80
commit
3a6e8bc887
@ -863,6 +863,7 @@ g_file_get_child (GFile *file,
|
|||||||
{
|
{
|
||||||
g_return_val_if_fail (G_IS_FILE (file), NULL);
|
g_return_val_if_fail (G_IS_FILE (file), NULL);
|
||||||
g_return_val_if_fail (name != NULL, NULL);
|
g_return_val_if_fail (name != NULL, NULL);
|
||||||
|
g_return_val_if_fail (!g_path_is_absolute (name), NULL);
|
||||||
|
|
||||||
return g_file_resolve_relative_path (file, name);
|
return g_file_resolve_relative_path (file, name);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user