f4b35e
diff -urNp old/plug-ins/common/file-gbr.c new/plug-ins/common/file-gbr.c
f4b35e
--- old/plug-ins/common/file-gbr.c	2018-01-04 12:13:17.553757864 +0100
f4b35e
+++ new/plug-ins/common/file-gbr.c	2018-01-04 12:18:01.723635742 +0100
f4b35e
@@ -443,7 +443,8 @@ load_image (const gchar  *filename,
f4b35e
     {
f4b35e
       gchar *temp = g_new (gchar, bn_size);
f4b35e
 
f4b35e
-      if ((read (fd, temp, bn_size)) < bn_size)
f4b35e
+      if ((read (fd, temp, bn_size)) < bn_size ||
f4b35e
+          temp[bn_size - 1] != '\0')
f4b35e
         {
f4b35e
           g_set_error (error, G_FILE_ERROR, G_FILE_ERROR_FAILED,
f4b35e
                        _("Error in GIMP brush file '%s'"),