1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

core: fix freeze when calling function util_file_get_content with a directory instead of a filename

This commit is contained in:
Sebastien Helleu
2011-10-19 13:41:34 +02:00
parent e26553fd9b
commit 0a2c938dae
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.6-rc2, 2011-10-15
v0.3.6-rc2, 2011-10-19
Version 0.3.6 (under dev!)
--------------------------
* core: fix freeze when calling function util_file_get_content with a directory
instead of a filename
* core: add color attribute "|" (keep attributes) and value "resetcolor" for
function weechat_color in plugin API (used by irc plugin to keep
bold/reverse/underlined in message when changing color) (bug #34550)
+5
View File
@@ -390,6 +390,11 @@ util_file_get_content (const char *filename)
}
buffer = buffer2;
count = fread (&buffer[fp], sizeof(char), 1024, f);
if (count <= 0)
{
free (buffer);
return NULL;
}
fp += count;
}
buffer2 = (char *) realloc (buffer, fp + sizeof (char));