From 8feb499ba2c3625632210c997b49f5df515c05d4 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Tue, 4 Aug 2009 18:13:09 +0100 Subject: [PATCH] Fix escaping of 8-bit high characters 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buf.c b/src/buf.c index 259175d8d9..c802aa2c61 100644 --- 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 !