[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libxlu_cfg: reject unknown characters following '\'



commit cf1416a6e87b92430c0082d9bc98c3993fac4642
Author:     Jim Fehlig <jfehlig@xxxxxxxx>
AuthorDate: Wed Feb 17 10:20:57 2016 -0700
Commit:     Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
CommitDate: Wed Feb 17 12:34:33 2016 -0500

    libxlu_cfg: reject unknown characters following '\'
    
    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@xxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 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 {
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.