Commit 280e2ef
boost::log throws conversion_error when logging wide strings containing
characters outside the system locale's encoding (e.g. emojis on C locale).
Since this exception is unhandled in the AMCP protocol handler, it kills
the connection.
Fix by sanitizing log output with replace_nonprintable() in the three
places where user-supplied wide strings are logged:
- AMCPProtocolStrategy: received AMCP messages
- html_producer: CEF console messages and renderer process messages
- strategy_adapters: sent response messages
Also replace boost::wformat with string concatenation in
html_cg_proxy::update() to avoid a secondary crash path, and use
explicit skip method for UTF-8 conversion to gracefully handle any
invalid sequences.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 9646d11 commit 280e2ef
File tree
4 files changed
+15
-13
lines changed- src
- modules/html/producer
- protocol
- amcp
- util
4 files changed
+15
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
| 407 | + | |
407 | 408 | | |
408 | | - | |
| 409 | + | |
409 | 410 | | |
410 | | - | |
| 411 | + | |
411 | 412 | | |
412 | | - | |
| 413 | + | |
413 | 414 | | |
414 | | - | |
| 415 | + | |
415 | 416 | | |
416 | | - | |
| 417 | + | |
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| |||
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
487 | | - | |
| 488 | + | |
488 | 489 | | |
489 | 490 | | |
490 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
| 144 | + | |
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
0 commit comments