Commit 5bedaf3
Fix SEGV when as_json returns a non-String for an invalid symbol
In strict mode, a Symbol whose name is not UTF-8 compatible was passed to
generate_json_string, which handed the as_json result to
raw_generate_json_string without checking its type. A non-String result was
then read as a String, segfaulting the process.
Route strict symbols through the T_STRING case of generate_json_general so
they reuse its as_json handling. That re-dispatches the result by type, and
its as_json_called flag stops a symbol returned by as_json from recursing.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent d3c7113 commit 5bedaf3
2 files changed
Lines changed: 42 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1124 | 1124 | | |
1125 | 1125 | | |
1126 | 1126 | | |
1127 | | - | |
1128 | | - | |
1129 | | - | |
1130 | | - | |
1131 | | - | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | 1127 | | |
1137 | 1128 | | |
1138 | 1129 | | |
| |||
1218 | 1209 | | |
1219 | 1210 | | |
1220 | 1211 | | |
1221 | | - | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1222 | 1219 | | |
1223 | 1220 | | |
1224 | 1221 | | |
| |||
1239 | 1236 | | |
1240 | 1237 | | |
1241 | 1238 | | |
| 1239 | + | |
1242 | 1240 | | |
1243 | 1241 | | |
1244 | 1242 | | |
| |||
1250 | 1248 | | |
1251 | 1249 | | |
1252 | 1250 | | |
1253 | | - | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1254 | 1258 | | |
1255 | 1259 | | |
1256 | 1260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
140 | 167 | | |
141 | 168 | | |
142 | 169 | | |
| |||
0 commit comments