summaryrefslogtreecommitdiffstats
path: root/lib/libcompat
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-14 22:25:15 +0000
committerache <ache@FreeBSD.org>1994-09-14 22:25:15 +0000
commitafaa039a5d994150893f34e86382c42ec9d8f373 (patch)
tree77e3b79c57d130a2966d76be6fe66ce0b85af320 /lib/libcompat
parentda9e71aeaf599c9d26bd3bc8d5cd2113641a6277 (diff)
downloadFreeBSD-src-afaa039a5d994150893f34e86382c42ec9d8f373.zip
FreeBSD-src-afaa039a5d994150893f34e86382c42ec9d8f373.tar.gz
Add sanity check for "no previous regular expression" state,
bringed by 'more'
Diffstat (limited to 'lib/libcompat')
-rw-r--r--lib/libcompat/4.3/regex.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libcompat/4.3/regex.c b/lib/libcompat/4.3/regex.c
index 89d6400..9b96978 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)
OpenPOWER on IntegriCloud