Clear newly allocated error buffer to avoid attempt to dereference an
invalid pointer when reporting an error while sourcing a file.  Without
this change I was seeing segfaults when attempting to source a file
containing a send2-hook with an invalid regexp in the pattern.
---
commands.c |    1 +
1 file changed, 1 insertion(+)

diff --git a/commands.c b/commands.c
index 13b12dd..fea9408 100644
--- a/commands.c
+++ b/commands.c
@@ -618,6 +618,7 @@ void mutt_enter_command (void)
  buffer[0] = 0;
  if (mutt_get_field (":", buffer, sizeof (buffer), M_COMMAND) != 0 || 
!buffer[0])
    return;
+  memset (&err, 0, sizeof (err));
  err.dsize = STRING;
  err.data = safe_malloc(err.dsize);
  memset (&token, 0, sizeof (token));
--
1.7.10.4

Reply via email to