1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 06:16:40 +02:00

core: check validity of buffer pointer when data is sent to a buffer

This commit is contained in:
Sebastien Helleu
2014-03-18 12:08:11 +01:00
parent 476729b897
commit ffb0ec47c2
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -15,6 +15,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
== Version 0.4.4 (under dev)
* core: check validity of buffer pointer when data is sent to a buffer
(command/text from user and API function "command")
* core: fix crash when buffer is closed during execution of multiple commands
(closes #27)
* core: fix compilation on SmartOS (bug #40981, closes #23)
+4 -1
View File
@@ -159,8 +159,11 @@ input_data (struct t_gui_buffer *buffer, const char *data)
const char *ptr_data, *ptr_data_for_buffer;
int length, char_size, first_command;
if (!buffer || !data || !data[0] || (data[0] == '\r') || (data[0] == '\n'))
if (!buffer || !gui_buffer_valid (buffer)
|| !data || !data[0] || (data[0] == '\r') || (data[0] == '\n'))
{
return;
}
buffer_full_name = strdup (buffer->full_name);
if (!buffer_full_name)