mlmmj.mlmmj.org archive mirror
 help / color / mirror / Atom feed
From: "Steffen (Daode) Nurpmeso" <steffen@sdaoden.eu>
To: mlmmj@mlmmj.org
Subject: [mlmmj] [PATCH 4/6] listcontrol(): be aware that ctrlvalues() can return NULL
Date: Thu, 25 Feb 2016 15:38:29 +0000	[thread overview]
Message-ID: <66f489ac3caecbe06fff91d6b1389e98db05272b.1456413512.git.steffen@sdaoden.eu> (raw)

---
 src/listcontrol.c | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/src/listcontrol.c b/src/listcontrol.c
index d0c2e14..0885573 100644
--- a/src/listcontrol.c
+++ b/src/listcontrol.c
@@ -886,15 +886,16 @@ permit:
 		if(statctrl(listdir, "nolistsubsemail"))
 			return -1;
 		owner_idx = -1;
-		owners = ctrlvalues(listdir, "owner");
-		for(i = 0; i < owners->count; i++) {
-			if(strcasecmp(fromemails->emaillist[0],
-						owners->strs[i]) = 0) {
-				log_oper(listdir, OPLOGFNAME,
-						"%s requested sub list",
-				fromemails->emaillist[0]);
-				owner_idx = i;
-				break;
+		if((owners = ctrlvalues(listdir, "owner")) != NULL){
+			for(i = 0; i < owners->count; i++) {
+				if(strcasecmp(fromemails->emaillist[0],
+							owners->strs[i]) = 0) {
+					log_oper(listdir, OPLOGFNAME,
+							"%s requested sub list",
+					fromemails->emaillist[0]);
+					owner_idx = i;
+					break;
+				}
 			}
 		}
 		if (owner_idx = -1) {
--
2.7.1


                 reply	other threads:[~2016-02-25 15:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=66f489ac3caecbe06fff91d6b1389e98db05272b.1456413512.git.steffen@sdaoden.eu \
    --to=steffen@sdaoden.eu \
    --cc=mlmmj@mlmmj.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).