summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:57:26 +0800
committerkcwu <kcwu@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-03-23 01:57:26 +0800
commitf3345cd954974f80862940ec628f17942a288316 (patch)
tree2a128eaf2a8808e479f898885094a32498bf7a2b
parent35e59bbab441a93c6079b1a64006e07b4f9b977c (diff)
downloadpttbbs-f3345cd954974f80862940ec628f17942a288316.tar
pttbbs-f3345cd954974f80862940ec628f17942a288316.tar.gz
pttbbs-f3345cd954974f80862940ec628f17942a288316.tar.bz2
pttbbs-f3345cd954974f80862940ec628f17942a288316.tar.lz
pttbbs-f3345cd954974f80862940ec628f17942a288316.tar.xz
pttbbs-f3345cd954974f80862940ec628f17942a288316.tar.zst
pttbbs-f3345cd954974f80862940ec628f17942a288316.zip
fix bugs introduced because replace sprintf and strncpy with snprintf and strlcpy without careful checks.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3292 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r--mbbsd/osdep.c2
-rw-r--r--mbbsd/record.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/mbbsd/osdep.c b/mbbsd/osdep.c
index 4872083e..f4a9bd85 100644
--- a/mbbsd/osdep.c
+++ b/mbbsd/osdep.c
@@ -613,7 +613,7 @@ cpuload(char *str)
}
if (str) {
if (l[0] != -1)
- snprintf(str, sizeof(str), " %.2f %.2f %.2f", l[0], l[1], l[2]);
+ sprintf(str, " %.2f %.2f %.2f", l[0], l[1], l[2]);
else
strcpy(str, " (unknown) ");
}
diff --git a/mbbsd/record.c b/mbbsd/record.c
index 987b3e3d..79523c69 100644
--- a/mbbsd/record.c
+++ b/mbbsd/record.c
@@ -574,7 +574,7 @@ append_record_forward(char *fpath, fileheader_t * record, int size, const char *
int n;
for (n = strlen(fpath) - 1; fpath[n] != '/' && n > 0; n--);
- strlcpy(buf, fpath, n + 1);
+ strncpy(buf, fpath, n + 1);
if (n + sizeof(".forward") > sizeof(buf))
return -1;
strcpy(buf + n + 1, ".forward");