diff options
author | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 05:24:54 +0800 |
---|---|---|
committer | piaip <piaip@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-16 05:24:54 +0800 |
commit | 257f7531d0785d0e1b802c487eae25efd14a03ec (patch) | |
tree | c2408bdb7d63562a87ba2dee3c1186780b07b0f6 | |
parent | 1e74218f83c72175954f25bff7ba13b78119a863 (diff) | |
download | pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar.gz pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar.bz2 pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar.lz pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar.xz pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.tar.zst pttbbs-257f7531d0785d0e1b802c487eae25efd14a03ec.zip |
* fix: memory leak + segv: passing incorrect parameter as buffer. (how can this be found so late!?)
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4629 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | mbbsd/bbslua.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mbbsd/bbslua.c b/mbbsd/bbslua.c index 1d09c271..76dbb529 100644 --- a/mbbsd/bbslua.c +++ b/mbbsd/bbslua.c @@ -1107,6 +1107,8 @@ bbslua_attach(const char *fpath, size_t *plen) static void bbslua_detach(char *p, int len) { + assert(p); + #ifdef BLCONF_MMAP_ATTACH munmap(p, len); #else // !BLCONF_MMAP_ATTACH @@ -1695,7 +1697,7 @@ bbslua(const char *fpath) strlcpy(bfpath, fpath, sizeof(bfpath)); // load file - bbslua_loadLatest(L, &ps, &ps, &pe, &pc, &sz, &lineshift, bfpath, &fpath); + bbslua_loadLatest(L, &bs, &ps, &pe, &pc, &sz, &lineshift, bfpath, &fpath); if (!ps || !pe || ps >= pe) { |