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 1273B6DE362A for ; Sat, 13 Aug 2016 04:40:55 -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.263 X-Spam-Level: X-Spam-Status: No, score=0.263 tagged_above=-999 required=5 tests=[AWL=0.983, 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 YT4BtQA3brrt for ; Sat, 13 Aug 2016 04:40:47 -0700 (PDT) Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id B97FD6DE396B for ; Sat, 13 Aug 2016 04:39:18 -0700 (PDT) Received: by mail-wm0-f68.google.com with SMTP id i138so2004561wmf.3 for ; Sat, 13 Aug 2016 04:39:18 -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=UVhi+QUjwZw1SZqSrybZOrF0QUN6p93rPTqsnwRVxoSuyRczSn/mAuUUV+ZSSYLLzb zVEd11PFwLpjke4FlbKT7hkP60/fo1SZvUBW4RYs9igqEeYtPLr+FEZBvvdJqvCFNe63 de2HWomCUx0Azv7LJFPNgjDfoRvvqp1Gktn2xBq7Dt5EhxGRouyXUlNyFUhQ4pvA+aT2 jTbfp+1zv6j5eiwaQk/zW8Wnq8luoyjX8WhRxvrVqjlA52260IG5p1fspCWEqN23WNB+ /ycEiLHHBIbPNxkiMr9b/LHFdNPOhmLB30vwKbzzlujBlxp1GBl5gV8j3RNQAFNMAzP6 pftw== 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=cIcYV2ZFIRw25/cs1B8N/2U89BHnV4FDLIqZy1BHfLAOhN5L8FrhnqevNHusYInZGC YW5mM+oS1+Yxl9tMUL9JO9kEV/essV1dsoRYNYHycLSQFrbl9IYXKRHxGdWTfb9/yb+P A/lZPMOMMu/eAWbGCZ27652B4l4DGZ9rkUKotzboK+zp0ayJFM7e2kXuh/5LdVtwiP4L U8DxBHM/IXApAyYyPvrnLHknJ89BG/btmE0i7WUgyvCWEol2aKnezE/OnQdp+9/HeD2+ ayLwmcs2+069nMHLRbIjnX2JvTpXAnGpnYF4lfyFKShBKSqAPGBio+DO5SkbKvzi4DKv xX/Q== X-Gm-Message-State: AEkoousiAGDDQHyncnqKV9D2U5FdHyQto9YtjrNgJzbQhJdDMuSYzxTyWxSDUzhFHDOJ0w== X-Received: by 10.28.111.4 with SMTP id k4mr3821636wmc.94.1471088357407; Sat, 13 Aug 2016 04:39:17 -0700 (PDT) Received: from localhost (dsl-hkibrasgw2-58c368-70.dhcp.inet.fi. [88.195.104.70]) by smtp.gmail.com with ESMTPSA id gg10sm11785883wjd.4.2016.08.13.04.39.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Aug 2016 04:39:17 -0700 (PDT) From: Jani Nikula To: notmuch@notmuchmail.org Cc: Daniel Kahn Gillmor , jani@nikula.org Subject: [PATCH v2 10/14] cli/reply: check for NULL list first in scan_address_list() Date: Sat, 13 Aug 2016 14:37:34 +0300 Message-Id: <275a85feea6afa5226d362f73e193694ea25e0b0.1471088022.git.jani@nikula.org> 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: Sat, 13 Aug 2016 11:40:55 -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