xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jim Fehlig <jfehlig@suse.com>
Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH V2 1/3] libxlu_cfg: reject unknown characters following '\'
Date: Wed, 17 Feb 2016 12:35:19 -0500	[thread overview]
Message-ID: <20160217173519.GF23435@char.us.oracle.com> (raw)
In-Reply-To: <1455729659-7885-2-git-send-email-jfehlig@suse.com>

On Wed, Feb 17, 2016 at 10:20:57AM -0700, Jim Fehlig wrote:
> 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>

applied
> ---
>  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
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

  reply	other threads:[~2016-02-17 17:35 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 ` [PATCH V2 1/3] libxlu_cfg: reject unknown characters following '\' Jim Fehlig
2016-02-17 17:35   ` Konrad Rzeszutek Wilk [this message]
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=20160217173519.GF23435@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jfehlig@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).