match: Don't dereference 's' directly.
Found by Coverity.
Этот коммит содержится в:
родитель
87036839f9
Коммит
ec56d1d453
@ -46,10 +46,14 @@
|
||||
* and * as wildcards), and zero if it does not match.
|
||||
*/
|
||||
static int match_pattern(const char *s, const char *pattern) {
|
||||
if (s == NULL || pattern == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (;;) {
|
||||
/* If at end of pattern, accept if also at end of string. */
|
||||
if (!*pattern) {
|
||||
return !*s;
|
||||
if (*pattern == '\0') {
|
||||
return (*s == '\0');
|
||||
}
|
||||
|
||||
if (*pattern == '*') {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user