]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix escaping of 8-bit high characters
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Aug 2009 17:13:09 +0000 (18:13 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 4 Aug 2009 17:13:09 +0000 (18:13 +0100)
Fix  https://bugzilla.redhat.com/show_bug.cgi?id=479517

* src/buf.c: Cast to 'unsigned char' before doing compare to
  avoid rejecting 8-bit high characters

src/buf.c

index 259175d8d95b445fc627678910761851ead8b4e7..c802aa2c61e63072d922b3d0407bd2f10c9aa450 100644 (file)
--- a/src/buf.c
+++ b/src/buf.c
@@ -304,7 +304,7 @@ virBufferEscapeString(const virBufferPtr buf, const char *format, const char *st
             *out++ = 'o';
             *out++ = 's';
             *out++ = ';';
-        } else if ((*cur >= 0x20) || (*cur == '\n') || (*cur == '\t') ||
+        } else if (((unsigned char)*cur >= 0x20) || (*cur == '\n') || (*cur == '\t') ||
                    (*cur == '\r')) {
             /*
              * default case, just copy !