bmf

bmf (Bayesian Mail Filter) 0.9.4 fork + patches
git clone git://git.codemadness.org/bmf
Log | Files | Refs | README | LICENSE

commit 2d06b1eeab72bd1e4715d9191ca2b03cd0ab50de
parent 40a406768615f5b89a6ba6e802fed5597c769c1a
Author: Julian Schweinsberg <pazz0@0xfa.de>
Date:   Sat, 26 Jan 2019 19:39:52 +0100

fix -d parameter

free(dbname) caused a crash, because dbname is initialized with a string constant

Diffstat:
Mbmf.c | 2+-
Mdbh.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/bmf.c b/bmf.c @@ -75,7 +75,7 @@ version(void) int main(int argc, char **argv) { - char *dbname = ""; + char *dbname = NULL; bool_t rdonly; runmode_t mode = mode_normal; mbox_t mboxtype = detect; diff --git a/dbh.c b/dbh.c @@ -64,7 +64,7 @@ dbtext_db_open(cpchar dbname, bool_t rdonly) pthis->close = dbtext_db_close; pthis->opentable = dbtext_db_opentable; - if (dbname[0]) { + if (dbname != NULL && dbname[0]) { dirlen = strlen(dbname); if ((pthis->dir = strdup(dbname)) == NULL) { perror("strdup()");