]> granicus.if.org Git - mutt/commitdiff
Catch possible bad memory access.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 19:28:42 +0000 (19:28 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 9 Nov 1998 19:28:42 +0000 (19:28 +0000)
from.c

diff --git a/from.c b/from.c
index 3a7ef6c6bf0a15420bd815d9839cfc6648badc95..b426e6901cf5b70dc9b1e70b6a9a49b72902e4ef 100644 (file)
--- a/from.c
+++ b/from.c
@@ -44,7 +44,7 @@ static int is_day_name (const char *s)
 {
   int i;
 
-  if (!ISSPACE (*(s+3)))
+  if ((strlen(s) < 3) || !*(s + 3) || !ISSPACE (*(s+3)))
     return 0;
   for (i=0; i<7; i++)
     if (strncasecmp (s, Weekdays[i], 3) == 0)