From patchwork Tue Aug 14 10:19:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 177210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 605942C0084 for ; Tue, 14 Aug 2012 20:19:29 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755843Ab2HNKTT (ORCPT ); Tue, 14 Aug 2012 06:19:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13146 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755844Ab2HNKTS (ORCPT ); Tue, 14 Aug 2012 06:19:18 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7EAJIKw005442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Aug 2012 06:19:18 -0400 Received: from dhcp-5-241.str.redhat.com (dhcp-5-241.str.redhat.com [10.32.5.241]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7EAJGve010760 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO) for ; Tue, 14 Aug 2012 06:19:18 -0400 Message-ID: <502A2624.6050701@redhat.com> Date: Tue, 14 Aug 2012 12:19:16 +0200 From: Florian Weimer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: netfilter-devel@vger.kernel.org Subject: [PATCH] mnl_attr_get_str: document that the result is not NUL-terminated X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Hi, while reviewing from libmnl-using code, I discovered that the result of mnl_attr_get_str was used as a NUL-terminated string, although in reality the string wasn't. I think this should be mentioned in the documentation. Florian From 1e4b192907eb15f4fbfd581c8c0fa8359aa9439f Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 14 Aug 2012 12:16:32 +0200 Subject: [PATCH] mnl_attr_get_str: document that the result is not NUL-terminated Signed-off-by: Florian Weimer --- src/attr.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/attr.c b/src/attr.c index 1136c50..c890bf2 100644 --- a/src/attr.c +++ b/src/attr.c @@ -393,6 +393,7 @@ EXPORT_SYMBOL(mnl_attr_get_u64); * \param attr pointer to netlink attribute * * This function returns the payload of string attribute value. + * Note that the string is not necessarily NUL-terminated. */ const char *mnl_attr_get_str(const struct nlattr *attr) { -- 1.7.7.6