lib/util: Fix segfault when validating filename
This change fixes the segfault issue when calling ostree_repo_checkout_tree with empty GFileInfo. A simple condition check for NULL value is added at src/libotutil/ot-unix-utils.c:46. Closes: ostreedev#1864. Closes: #1868 Approved by: jlebon
This commit is contained in:
parent
e0ddaa811b
commit
6733843f87
|
|
@ -43,6 +43,8 @@ gboolean
|
||||||
ot_util_filename_validate (const char *name,
|
ot_util_filename_validate (const char *name,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
if (name == NULL)
|
||||||
|
return glnx_throw (error, "Invalid NULL filename");
|
||||||
if (strcmp (name, ".") == 0)
|
if (strcmp (name, ".") == 0)
|
||||||
return glnx_throw (error, "Invalid self-referential filename '.'");
|
return glnx_throw (error, "Invalid self-referential filename '.'");
|
||||||
if (strcmp (name, "..") == 0)
|
if (strcmp (name, "..") == 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue