summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.asciidoc2
-rw-r--r--src/core/wee-input.c5
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc
index 56574ff82..658685ba8 100644
--- a/ChangeLog.asciidoc
+++ b/ChangeLog.asciidoc
@@ -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)
diff --git a/src/core/wee-input.c b/src/core/wee-input.c
index beef72d9d..ad4eb08b6 100644
--- a/src/core/wee-input.c
+++ b/src/core/wee-input.c
@@ -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)