mirror of https://github.com/GNOME/gimp.git
app: don't potentially overread buffer
If a file has more than 4kB on the first line and starts with #!, then we would pass a non-null terminated string to strchr. Found by coverity.
This commit is contained in:
parent
1947d8def8
commit
3c2cb65088
|
@ -733,7 +733,7 @@ gimp_interpreter_db_resolve (GimpInterpreterDB *db,
|
|||
return resolve_extension (db, program_path);
|
||||
|
||||
memset (buffer, 0, sizeof (buffer));
|
||||
len = read (fd, buffer, sizeof (buffer));
|
||||
len = read (fd, buffer, sizeof (buffer) - 1); /* leave one nul at the end */
|
||||
close (fd);
|
||||
|
||||
if (len <= 0)
|
||||
|
|
Loading…
Reference in New Issue