From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id BE4F26DE0363 for ; Sun, 19 Jun 2016 13:17:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: 0.448 X-Spam-Level: X-Spam-Status: No, score=0.448 tagged_above=-999 required=5 tests=[AWL=1.168, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4FhzPs5LzdrO for ; Sun, 19 Jun 2016 13:17:11 -0700 (PDT) Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by arlo.cworth.org (Postfix) with ESMTPS id 273186DE01CE for ; Sun, 19 Jun 2016 13:17:05 -0700 (PDT) Received: by mail-wm0-f65.google.com with SMTP id c82so6633535wme.3 for ; Sun, 19 Jun 2016 13:17:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=7tsiGkg0FFMzDlQ3hfJSIFhyiHhCYGrgYwx2Ox7gEOc=; b=z4yJvkXiroT3Ifnj5pOwz3QPPs159J7pxhfCBbgCyfZZxoHnZNPa7pga55psod9bSx HSh+GdfxRUqo2+TggVcJmLnf3GrBSYIgOjIQz/gSDoJbr8mU1yWbFeO1osQHCFWvAv8o C7hlmJ5DRScV7ImD0kJNiqJcA1K8s9JQVPX/ma4/sn2g9fHSCgHvzwsmoep9tjhBX2Oc sHDlrCQXJmEzi9AIPNXSoGsIUR5Ja3bcyDE35z7a1nIiC6oGoRI3l0u64EMBcmrmakFG eny53ns9uCUZmc1KX4gT7B5hwzfQzZ41dBkbSbm9mRX1UwXbD1Rc/HbR8LalsFYDQWzN doTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=7tsiGkg0FFMzDlQ3hfJSIFhyiHhCYGrgYwx2Ox7gEOc=; b=K5hyu5qzOtYkAkWqswHPS/olSSwr9i/IqOZyOy0+u9v60wZEJgvQ4qQVvXFOCSDFEp SOC2lnCHBhUC3GFr/Kr95prZNTS530OjP/oaRgwYr2BuBrzCC5Nu9cdhXKyyfYf/doto wtFpZLT9i2/K8O+UkMtjkedaX63UXr/lyVGC3XE+6m/zkUZk7uwmgi3jWyN4Hqb2Mp7c mvFA9fhJ2cb0s0R/xMgqQMqZCH7J4sYrNFjTv9YRyUJGUfgDRWLdeK+z086wkpUMQc/Z LUHH0R2xrDsP3wzZIpKbYmi/yzau8MSElvi1UFsUrDefAxjzXvnyhx5O14rXMCST/hv2 V6yQ== X-Gm-Message-State: ALyK8tKUR/zW3TE50Elv9D1o/RrpovUAwbnwEj6WM0H2xKQEOHFTmGCd8RBCOsVZ9IdDmA== X-Received: by 10.195.11.40 with SMTP id ef8mr11052618wjd.137.1466367423796; Sun, 19 Jun 2016 13:17:03 -0700 (PDT) Received: from localhost (dsl-hkibrasgw2-58c37a-44.dhcp.inet.fi. [88.195.122.44]) by smtp.gmail.com with ESMTPSA id o2sm33403765wjp.26.2016.06.19.13.17.03 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 13:17:03 -0700 (PDT) From: Jani Nikula To: Jani Nikula , notmuch@notmuchmail.org Cc: Daniel Kahn Gillmor Subject: [RFC PATCH 2/6] cli/reply: check for NULL list first in scan_address_list() Date: Sun, 19 Jun 2016 23:15:30 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 20:17:18 -0000 Support passing NULL list later on. Also use it to simplify the recursion. --- notmuch-reply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 9b78ea2c2b20..d90f46f9bed3 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -192,6 +192,9 @@ scan_address_list (InternetAddressList *list, int i; unsigned int n = 0; + if (list == NULL) + return 0; + for (i = 0; i < internet_address_list_length (list); i++) { address = internet_address_list_get_address (list, i); if (INTERNET_ADDRESS_IS_GROUP (address)) { @@ -200,9 +203,6 @@ scan_address_list (InternetAddressList *list, group = INTERNET_ADDRESS_GROUP (address); group_list = internet_address_group_get_members (group); - if (group_list == NULL) - continue; - n += scan_address_list (group_list, config, message, type, user_from); } else { InternetAddressMailbox *mailbox; -- 2.1.4