We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6635326 commit f3a119aCopy full SHA for f3a119a
src/json.cpp
@@ -28,6 +28,10 @@
28
29
#include "json.hpp"
30
31
+// include utf8 library used by libsass
32
+// ToDo: replace internal json utf8 code
33
+#include "utf8.h"
34
+
35
#include <assert.h>
36
#include <stdint.h>
37
#include <stdio.h>
@@ -1141,6 +1145,13 @@ void emit_string(SB *out, const char *str)
1141
1145
const char *s = str;
1142
1146
char *b;
1143
1147
1148
+// make assertion catchable
1149
+#ifndef NDEBUG
1150
+ if (!utf8_validate(str)) {
1151
+ throw utf8::invalid_utf8(0);
1152
+ }
1153
+#endif
1154
1144
1155
assert(utf8_validate(str));
1156
1157
/*
0 commit comments