Commit 6074d4d8 6074d4d856c861d0a5df9b39d7421bc186ce2056 by Sergey Poznyakoff

Fix eventual memory overrun

* mail/mail.c (mail_mainloop): Check command length before
trying to access its last byte.
1 parent 25f14bdd
......@@ -558,7 +558,7 @@ mail_mainloop (char *(*input) (void *, int),
while ((command = (*input) (closure, 0)) != NULL)
{
int len = strlen (command);
while (command[len-1] == '\\')
while (len > 0 && command[len-1] == '\\')
{
char *buf;
char *command2 = (*input) (closure, 1);
......