From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH V2 1/3] libxlu_cfg: reject unknown characters following '\' Date: Wed, 17 Feb 2016 12:35:19 -0500 Message-ID: <20160217173519.GF23435@char.us.oracle.com> References: <1455729659-7885-1-git-send-email-jfehlig@suse.com> <1455729659-7885-2-git-send-email-jfehlig@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1455729659-7885-2-git-send-email-jfehlig@suse.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jim Fehlig Cc: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, ian.campbell@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org 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 > Acked-by: Ian Campbell 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