Explorar o código

Merge pull request #6968 from afishbeck/hexViewResult506

HPCC-12829 Fix JSON escaping of character '\0'

Reviewed-By:Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=10) %!d(string=hai) anos
pai
achega
de7fc111f3
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      system/jlib/jstring.cpp

+ 3 - 0
system/jlib/jstring.cpp

@@ -2003,6 +2003,9 @@ inline StringBuffer &encodeJSONChar(StringBuffer &s, const char *&ch, unsigned &
             s.append('\\');
             s.append(next);
             break;
+        case '\0':
+            s.append("\\u0000");
+            break;
         default:
             if (next >= ' ' && next < 128)
                 s.append(next);