From: Zdenek Kabelac <zkabelac@fedoraproject.org>
To: lvm-devel@redhat.com
Subject: master - libdm: improve check in dm_split_lvm_name
Date: Sun, 21 Apr 2013 21:16:52 +0000 (UTC) [thread overview]
Message-ID: <20130421211652.07DDB910@fedorahosted.org> (raw)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8f1dd00c3634d111be9a42524ab50b2f31962530
Commit: 8f1dd00c3634d111be9a42524ab50b2f31962530
Parent: a2b76a6f022920abd59072decfa7d3d76eeda913
Author: Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate: Sun Apr 21 12:48:24 2013 +0200
Committer: Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Sun Apr 21 23:10:43 2013 +0200
libdm: improve check in dm_split_lvm_name
We support both type of call - with or without mem pool.
So ensure we will not use NULL vgname also when mem is given.
---
libdm/libdm-string.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-string.c b/libdm/libdm-string.c
index 5ef6334..9d667bb 100644
--- a/libdm/libdm-string.c
+++ b/libdm/libdm-string.c
@@ -92,7 +92,10 @@ static char *_unquote(char *component)
int dm_split_lvm_name(struct dm_pool *mem, const char *dmname,
char **vgname, char **lvname, char **layer)
{
- if (mem && !(*vgname = dm_pool_strdup(mem, dmname)))
+ if (mem)
+ *vgname = dm_pool_strdup(mem, dmname);
+
+ if (!*vgname)
return 0;
_unquote(*layer = _unquote(*lvname = _unquote(*vgname)));
reply other threads:[~2013-04-21 21:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20130421211652.07DDB910@fedorahosted.org \
--to=zkabelac@fedoraproject.org \
--cc=lvm-devel@redhat.com \
/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.