From: Florian Weimer <fweimer@redhat.com>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH] mnl_attr_get_str: document that the result is not NUL-terminated
Date: Tue, 14 Aug 2012 12:19:16 +0200 [thread overview]
Message-ID: <502A2624.6050701@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 289 bytes --]
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
--
Florian Weimer / Red Hat Product Security Team
[-- Attachment #2: 0001-mnl_attr_get_str-document-that-the-result-is-not-NUL.patch --]
[-- Type: text/x-patch, Size: 769 bytes --]
>From 1e4b192907eb15f4fbfd581c8c0fa8359aa9439f Mon Sep 17 00:00:00 2001
From: Florian Weimer <fweimer@redhat.com>
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 <fweimer@redhat.com>
---
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
next reply other threads:[~2012-08-14 10:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-14 10:19 Florian Weimer [this message]
2012-08-14 10:46 ` [PATCH] mnl_attr_get_str: document that the result is not NUL-terminated Jan Engelhardt
2012-08-14 11:10 ` Pablo Neira Ayuso
2012-08-14 11:28 ` Florian Weimer
2012-08-14 11:59 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=502A2624.6050701@redhat.com \
--to=fweimer@redhat.com \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.