diff options
Diffstat (limited to 'usr.bin/make/str.c')
-rw-r--r-- | usr.bin/make/str.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/make/str.c b/usr.bin/make/str.c index 4889ec9..097e312 100644 --- a/usr.bin/make/str.c +++ b/usr.bin/make/str.c @@ -417,6 +417,12 @@ Str_SYSVMatch(word, pattern, len) char *w = word; char *m; + if (*w == '\0') { + /* Zero-length word cannot be matched against */ + *len = 0; + return NULL; + } + if (*p == '\0') { /* Null pattern is the whole string */ *len = strlen(w); |