From c5f3ddc331f24f1f47080c2468187d30ef04c2a6 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Mon, 27 Jul 2009 21:14:29 -0700 Subject: [PATCH] Properly propagate mh_read_sequences result. Closes #3308. --- mh.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mh.c b/mh.c index e46819cde..b03e71465 100644 --- a/mh.c +++ b/mh.c @@ -167,7 +167,7 @@ static int mh_read_sequences (struct mh_sequences *mhs, const char *path) size_t sz = 0; short f; - int first, last, rc; + int first, last, rc = 0; char pathname[_POSIX_PATH_MAX]; snprintf (pathname, sizeof (pathname), "%s/.mh_sequences", path); @@ -207,7 +207,7 @@ static int mh_read_sequences (struct mh_sequences *mhs, const char *path) out: FREE (&buff); safe_fclose (&fp); - return 0; + return rc; } static inline mode_t mh_umask (CONTEXT* ctx) @@ -1156,7 +1156,7 @@ int mh_read_dir (CONTEXT * ctx, const char *subdir) if (ctx->magic == M_MH) { - if (mh_read_sequences (&mhs, ctx->path) >= 0) + if (mh_read_sequences (&mhs, ctx->path) < 0) return -1; mh_update_maildir (md, &mhs); mhs_free_sequences (&mhs); -- 2.40.0