freebsd-ports/x11-toolkits/eel/files/patch-eel::eel-vfs-extensions.c
Maxim Sobolev 089fc7522f In a function eel_read_entire_file() allocate extra byte and ensure that the
read buffer is terminated by '\0', because it seems that Nautilus expects it
to be. The proper fix would be to fix Nautilus instead, but I'll leave this
excersise to Nautilus developers. This should fix one of the most frequent
crashes I've saw in Nautilus so far. Bump PORTREVISION.

Recommended update.
2001-12-20 14:04:25 +00:00

16 lines
385 B
C

$FreeBSD$
--- eel/eel-vfs-extensions.c 2001/12/20 13:41:21 1.1
+++ eel/eel-vfs-extensions.c 2001/12/20 13:47:36
@@ -116,7 +116,8 @@
/* Return the file. */
*file_size = total_bytes_read;
- *file_contents = g_realloc (buffer, total_bytes_read);
+ *file_contents = g_realloc (buffer, total_bytes_read + 1);
+ (*file_contents)[total_bytes_read] = '\0';
return GNOME_VFS_OK;
}