From patchwork Fri Jun 22 00:21:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 379 Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director11.mail.ord1d.rsapps.net ([172.31.255.6]) by backend30.mail.ord1d.rsapps.net (Dovecot) with LMTP id 25hKJtTNLFv5BgAAIUCqbw for ; Fri, 22 Jun 2018 06:22:12 -0400 Received: from proxy15.mail.iad3b.rsapps.net ([172.31.255.6]) by director11.mail.ord1d.rsapps.net (Dovecot) with LMTP id U6PsH9TNLFulRgAAvGGmqA ; Fri, 22 Jun 2018 06:22:12 -0400 Received: from smtp8.gate.iad3b ([172.31.255.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy15.mail.iad3b.rsapps.net with LMTP id aE3cHdTNLFtEfQAAhyf7VQ ; Fri, 22 Jun 2018 06:22:12 -0400 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp8.gate.iad3b.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dmarc=none (p=nil; dis=none) header.from=unstable.cc X-Suspicious-Flag: YES X-Classification-ID: 202fcc78-7606-11e8-88f7-5254005eee35-1-1 Received: from [216.105.38.7] ([216.105.38.7:29861] helo=lists.sourceforge.net) by smtp8.gate.iad3b.rsapps.net (envelope-from ) (ecelerity 4.2.1.56364 r(Core:4.2.1.14)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id AD/EB-08543-4DDCC2B5; Fri, 22 Jun 2018 06:22:12 -0400 Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1fWJCA-0007VQ-GL; Fri, 22 Jun 2018 10:21:34 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1fWJC9-0007V8-40 for openvpn-devel@lists.sourceforge.net; Fri, 22 Jun 2018 10:21:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xts0M7xNbUBITjfbQXk9djWPIDTq8lnpy/B+d0Tb7l0=; b=Y5jCZaBiZEyhmx0wojnDpPcPio pNnZynx2RHtqNLs/Q5s4hxl4RNnqqWBuxDmjh2o6v03zOKlEQ/GFEh9moR1zLAiyYcF+PmzssyltF Q5uMNZpOISEkSlqNEVqhDbm71dBGN/uWyCj17VuWxDHf79/nGQAkoSMMDBwQnKzxMbQ8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version: Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=xts0M7xNbUBITjfbQXk9djWPIDTq8lnpy/B+d0Tb7l0=; b=cTq/Yufod1wZnpFNVC57ehhjFl 2TW3brPZIzvyi3S/xAB3O2zwZ6K/b6qPVmXSolZbOGAxJsKuqOSsVr6wNmXXGhij+IpwKv9Njxji/ MYA1yyVHcsW5/E2hAQGyR4gk4JBcs7OPq3EC2KQnJK4AyOBsDVpGJBJD0xnFbB1Br70I=; Received: from s2.neomailbox.net ([5.148.176.60]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) id 1fWJC7-0060JL-9A for openvpn-devel@lists.sourceforge.net; Fri, 22 Jun 2018 10:21:33 +0000 From: Antonio Quartulli To: openvpn-devel@lists.sourceforge.net Date: Fri, 22 Jun 2018 18:21:10 +0800 Message-Id: <20180622102110.21888-1-a@unstable.cc> X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [5.148.176.60 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.2 AWL AWL: Adjusted score from AWL reputation of From: address X-Headers-End: 1fWJC7-0060JL-9A Subject: [Openvpn-devel] [PATCH] route: fix format string passed to argv_printf X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Antonio Quartulli MIME-Version: 1.0 Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox %lu is not supported by our tiny argv_printf implementation and will trigger an ASSERT() when parsing it. Even though this particular ASSERT() is not critical as it happens during shutdown, we still have to fix it. Since in this case the code is trying to use a DWORD variable as argument, and we know that DWORD is an unsigned long, which in turn is 32bit long on MS Windows (32 and 64bit version)[1][2], simply use the already supported %u instead of %lu. [1]https://msdn.microsoft.com/en-us/library/aa383751(VS.85).aspx [2]https://en.wikipedia.org/wiki/Integer_(computer_science)#Long_integer Signed-off-by: Antonio Quartulli --- src/openvpn/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openvpn/route.c b/src/openvpn/route.c index a45a273a..209daeab 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -1616,7 +1616,7 @@ add_route(struct route_ipv4 *r, const struct tuntap *tt, unsigned int flags, if (is_on_link(is_local_route, flags, rgi)) { ai = rgi->adapter_index; - argv_printf_cat(&argv, "IF %lu", ai); + argv_printf_cat(&argv, "IF %u", ai); } argv_msg(D_ROUTE, &argv);