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:
@@ -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)
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user