diff options
| author | Sam Varshavchik | 2022-05-24 00:00:05 -0400 |
|---|---|---|
| committer | Sam Varshavchik | 2022-05-24 00:02:28 -0400 |
| commit | 36657a43147aeb82a5b109d896025be3237d2296 (patch) | |
| tree | f1dad66472825b6c73fdd2608eccdb79be271189 /sqwebmail/maildir.c | |
| parent | 27df85cdad37e4945b1144ed2d4be92b40e4519f (diff) | |
| download | courier-libs-36657a43147aeb82a5b109d896025be3237d2296.tar.bz2 | |
Assorted bug fixes.
Minor read-only use after free. OpenSSL 3.0 tweaks.
Diffstat (limited to 'sqwebmail/maildir.c')
| -rw-r--r-- | sqwebmail/maildir.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/sqwebmail/maildir.c b/sqwebmail/maildir.c index fd12182..f22062e 100644 --- a/sqwebmail/maildir.c +++ b/sqwebmail/maildir.c @@ -927,6 +927,7 @@ static int do_msgmove(const char *from, { free(destdir); enomem(); + exit(0); /* gcc warning fix */ } strcat(strcpy(p, destdir), "/shared"); free(destdir); @@ -3046,23 +3047,24 @@ static void maildir_save_start(const char *folder, save_time=t; #if 1 { - int f = -1; - char *tmpfname = alloc_filename(maildir, - "", MAILDIRCURCACHE ".nfshack"); - if (tmpfname) { - f = open(tmpfname, O_CREAT|O_WRONLY, 0600); - free(tmpfname); - } - if (f != -1) { - struct stat s; - if (write(f, ".", 1) != 1) - ; /* ignore */ - fsync(f); - if (fstat(f, &s) == 0) - save_time = s.st_mtime; - close(f); - unlink(tmpfname); - } + int f = -1; + char *tmpfname = alloc_filename(maildir, + "", MAILDIRCURCACHE ".nfshack"); + if (tmpfname) { + f = open(tmpfname, O_CREAT|O_WRONLY, 0600); + + if (f != -1) { + struct stat s; + if (write(f, ".", 1) != 1) + ; /* ignore */ + fsync(f); + if (fstat(f, &s) == 0) + save_time = s.st_mtime; + close(f); + unlink(tmpfname); + } + free(tmpfname); + } } #endif |
