From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752715AbaGZTDF (ORCPT ); Sat, 26 Jul 2014 15:03:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33744 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752538AbaGZTDC (ORCPT ); Sat, 26 Jul 2014 15:03:02 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Hutchings , "David S. Miller" Subject: [PATCH 3.10 40/56] dns_resolver: Null-terminate the right string Date: Sat, 26 Jul 2014 12:02:33 -0700 Message-Id: <20140726190201.362533269@linuxfoundation.org> X-Mailer: git-send-email 2.0.2 In-Reply-To: <20140726190200.061512159@linuxfoundation.org> References: <20140726190200.061512159@linuxfoundation.org> User-Agent: quilt/0.63-1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ben Hutchings [ Upstream commit 640d7efe4c08f06c4ae5d31b79bd8740e7f6790a ] *_result[len] is parsed as *(_result[len]) which is not at all what we want to touch here. Signed-off-by: Ben Hutchings Fixes: 84a7c0b1db1c ("dns_resolver: assure that dns_query() result is null-terminated") Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/dns_resolver/dns_query.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/net/dns_resolver/dns_query.c +++ b/net/dns_resolver/dns_query.c @@ -151,7 +151,7 @@ int dns_query(const char *type, const ch goto put; memcpy(*_result, upayload->data, len); - *_result[len] = '\0'; + (*_result)[len] = '\0'; if (_expiry) *_expiry = rkey->expiry;