mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 01:43:24 +00:00
Merge branch 'lillolollo-master-patch-25038' into 'master'
plug-ins/file-lnk avoid possible underflow See merge request GNOME/gimp!2118
This commit is contained in:
commit
dfcec81a23
1 changed files with 25 additions and 21 deletions
|
@ -252,8 +252,13 @@ load_image (GFile *file,
|
||||||
/* Length of the filename */
|
/* Length of the filename */
|
||||||
link_size = length - link_pos - 1;
|
link_size = length - link_pos - 1;
|
||||||
|
|
||||||
if (link_size > 0)
|
if (link_size <= 0) {
|
||||||
{
|
g_set_error (error, G_FILE_ERROR, g_file_error_from_errno (errno),
|
||||||
|
_("Invalid file."));
|
||||||
|
fclose (fp);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
gchar file_name[link_size];
|
gchar file_name[link_size];
|
||||||
|
|
||||||
/* Jump to link address and read in the real file name */
|
/* Jump to link address and read in the real file name */
|
||||||
|
@ -274,7 +279,6 @@ load_image (GFile *file,
|
||||||
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
|
||||||
"%s", gimp_pdb_get_last_error (gimp_get_pdb ()));
|
"%s", gimp_pdb_get_last_error (gimp_get_pdb ()));
|
||||||
|
|
||||||
}
|
|
||||||
fclose (fp);
|
fclose (fp);
|
||||||
|
|
||||||
return image;
|
return image;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue