summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 16:22:08 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2005-02-06 16:22:08 +0800
commit0beba6441cc34cb1fb7c0350882e3ae256b5309d (patch)
treef1a344e0fff2b3d808e5308c88b0fa5d55dd0e05 /mbbsd
parentf5c7e0e313ec1616f33a610c873741ae73497529 (diff)
downloadpttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar.gz
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar.bz2
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar.lz
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar.xz
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.tar.zst
pttbbs-0beba6441cc34cb1fb7c0350882e3ae256b5309d.zip
replace strstr_lower(), which cause buffer overflow with strcasestr()
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@2474 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/announce.c2
-rw-r--r--mbbsd/indict.c2
-rw-r--r--mbbsd/stuff.c9
3 files changed, 2 insertions, 11 deletions
diff --git a/mbbsd/announce.c b/mbbsd/announce.c
index aad29a92..2e74c9dd 100644
--- a/mbbsd/announce.c
+++ b/mbbsd/announce.c
@@ -113,7 +113,7 @@ a_searchtitle(menu_t * pm, int rev)
pm->page = pos - pos % p_lines;
a_loadname(pm);
}
- if (strstr_lower(pm->header[pos - pm->page].title, search_str))
+ if (strcasestr(pm->header[pos - pm->page].title, search_str))
return pos;
} while (pos != pm->now);
return pm->now;
diff --git a/mbbsd/indict.c b/mbbsd/indict.c
index 317fb5b0..ba1d84e8 100644
--- a/mbbsd/indict.c
+++ b/mbbsd/indict.c
@@ -126,7 +126,7 @@ use_dict(char *dict,char *database)
f = 1;
} else
f = 0;
- if (strstr_lower(lang, word)) {
+ if (strcasestr(lang, word)) {
if (f == 1)
lang[65] = '[';
outs(lang);
diff --git a/mbbsd/stuff.c b/mbbsd/stuff.c
index 602c9b4b..c9f31e7d 100644
--- a/mbbsd/stuff.c
+++ b/mbbsd/stuff.c
@@ -138,15 +138,6 @@ str_lower(char *t, char *s)
} while (ch);
}
-void *
-strstr_lower(char *str, char *tag)
-{
- char buf[STRLEN];
-
- str_lower(buf, str);
- return strstr(buf, tag);
-}
-
/**
* 移除字串 buf 後端多餘的空白。
* @param buf