mirror of
https://github.com/flatpak/flatpak.git
synced 2026-06-19 22:11:01 -04:00
Always set an error when failing name validation
This was an oversight in the previous patch to improve name validation error messages.
This commit is contained in:
@@ -416,8 +416,19 @@ flatpak_is_valid_name (const char *string,
|
||||
ret = FALSE;
|
||||
|
||||
len = strlen (string);
|
||||
if (G_UNLIKELY (len == 0 || len > 255))
|
||||
goto out;
|
||||
if (G_UNLIKELY (len == 0))
|
||||
{
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Name can't be empty");
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (G_UNLIKELY (len > 255))
|
||||
{
|
||||
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Name can't be longer than 255 characters");
|
||||
goto out;
|
||||
}
|
||||
|
||||
end = string + len;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user