diff options
author | ache <ache@FreeBSD.org> | 1994-09-14 22:25:15 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-09-14 22:25:15 +0000 |
commit | afaa039a5d994150893f34e86382c42ec9d8f373 (patch) | |
tree | 77e3b79c57d130a2966d76be6fe66ce0b85af320 /lib/libcompat/4.3 | |
parent | da9e71aeaf599c9d26bd3bc8d5cd2113641a6277 (diff) | |
download | FreeBSD-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/4.3')
-rw-r--r-- | lib/libcompat/4.3/regex.c | 5 |
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) |