From a7f57b7141ee0ff5ef3fde7f982787fc0d296d62 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Wed, 14 Sep 1994 22:25:15 +0000 Subject: [PATCH] Add sanity check for "no previous regular expression" state, bringed by 'more' --- lib/libcompat/4.3/regex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/libcompat/4.3/regex.c b/lib/libcompat/4.3/regex.c index 89d6400b8d7d..9b9697885e42 100644 --- a/lib/libcompat/4.3/regex.c +++ b/lib/libcompat/4.3/regex.c @@ -59,8 +59,11 @@ char * re_comp(s) char *s; { - if (s == NULL || *s == '\0') + if (s == NULL || *s == '\0') { + if (re_regexp == NULL) + return "no previous regular expression"; return (NULL); + } if (re_regexp) free(re_regexp); if (re_errstr)