From: Jim Fehlig <jfehlig@suse.com>
To: xen-devel@lists.xen.org
Cc: wei.liu2@citrix.com, Jim Fehlig <jfehlig@suse.com>,
ian.jackson@eu.citrix.com, ian.campbell@citrix.com
Subject: [PATCH V2 1/3] libxlu_cfg: reject unknown characters following '\'
Date: Wed, 17 Feb 2016 10:20:57 -0700 [thread overview]
Message-ID: <1455729659-7885-2-git-send-email-jfehlig@suse.com> (raw)
In-Reply-To: <1455729659-7885-1-git-send-email-jfehlig@suse.com>
When dequoting config strings in xlu__cfgl_dequote(), unknown
characters following a '\', and the '\' itself, are discarded.
E.g. a disk configuration string containing
rbd:pool/image:mon_host=192.168.0.100\:6789
would be dequoted as
rbd:pool/image:mon_host=192.168.0.1006789
Instead of discarding the '\' and unknown character, reject the
string and set error to EINVAL.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
---
tools/libxl/libxlu_cfg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/libxl/libxlu_cfg.c b/tools/libxl/libxlu_cfg.c
index 1d70909..5838f68 100644
--- a/tools/libxl/libxlu_cfg.c
+++ b/tools/libxl/libxlu_cfg.c
@@ -533,6 +533,11 @@ char *xlu__cfgl_dequote(CfgParseContext *ctx, const char *src) {
NUMERIC_CHAR(2,2,16,"hex");
} else if (nc>='0' && nc<='7') {
NUMERIC_CHAR(1,3,10,"octal");
+ } else {
+ xlu__cfgl_lexicalerror(ctx,
+ "invalid character after backlash in quoted string");
+ ctx->err= EINVAL;
+ goto x;
}
assert(p <= src+len-1);
} else {
--
2.1.4
next prev parent reply other threads:[~2016-02-17 17:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-17 17:20 [PATCH V2 0/3] libxl and docs: small improvements in qdisk support Jim Fehlig
2016-02-17 17:20 ` Jim Fehlig [this message]
2016-02-17 17:35 ` [PATCH V2 1/3] libxlu_cfg: reject unknown characters following '\' Konrad Rzeszutek Wilk
2016-02-17 17:20 ` [PATCH V2 2/3] docs: fix typo in xl-disk-configuration.txt Jim Fehlig
2016-02-17 17:35 ` Konrad Rzeszutek Wilk
2016-02-17 17:20 ` [PATCH V2 3/3] docs: add more info about target= in disk config Jim Fehlig
2016-02-18 10:24 ` Ian Campbell
2016-02-19 17:25 ` Ian Jackson
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=1455729659-7885-2-git-send-email-jfehlig@suse.com \
--to=jfehlig@suse.com \
--cc=ian.campbell@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.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.