diff options
author | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-21 01:18:53 +0800 |
---|---|---|
committer | kcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2007-09-21 01:18:53 +0800 |
commit | b9539de0ffa696b5f8debe2d3e91e4eab81004fa (patch) | |
tree | 0d7dcb34b8264f4e6579452ee580c41d55f5cc85 /mbbsd/lovepaper.c | |
parent | 2b3b00dc185e362e46f93a6ad50fb4d423452551 (diff) | |
download | pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.gz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.bz2 pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.lz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.xz pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.tar.zst pttbbs-b9539de0ffa696b5f8debe2d3e91e4eab81004fa.zip |
* fix bug: don't getdata() on non-local variable directly, to avoid reentrant crash.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3564 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'mbbsd/lovepaper.c')
-rw-r--r-- | mbbsd/lovepaper.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/mbbsd/lovepaper.c b/mbbsd/lovepaper.c index 8e9f5267..7cb49c12 100644 --- a/mbbsd/lovepaper.c +++ b/mbbsd/lovepaper.c @@ -5,7 +5,7 @@ int x_love(void) { - char buf1[200], save_title[TTLEN + 1]; + char buf1[200], title[TTLEN + 1]; char receiver[61], path[STRLEN] = "home/"; int x, y = 0, tline = 0, poem = 0; FILE *fp, *fpo; @@ -26,8 +26,8 @@ x_love(void) if (!getdata(7, 0, "收信人:", receiver, sizeof(receiver), DOECHO)) return 0; if (receiver[0] && !(searchuser(receiver, receiver) && - getdata(8, 0, "主 題:", save_title, - sizeof(save_title), DOECHO))) { + getdata(8, 0, "主 題:", title, + sizeof(title), DOECHO))) { move(10, 0); vmsg("收信人或主題不正確,情書無法傳遞"); return 0; @@ -94,7 +94,7 @@ x_love(void) sethomepath(buf1, receiver); stampfile(buf1, &mhdr); Rename(path, buf1); - strlcpy(mhdr.title, save_title, sizeof(mhdr.title)); + strlcpy(mhdr.title, title, sizeof(mhdr.title)); strlcpy(mhdr.owner, cuser.userid, sizeof(mhdr.owner)); sethomedir(path, receiver); if (append_record(path, &mhdr, sizeof(mhdr)) == -1) |