Skip to content

Commit fc78685

Browse files
authored
Merge pull request #1214 from jasonmolenda/eng/PR-62873581
Quote error string from qLaunchSuccess
2 parents f3eb161 + b6311ca commit fc78685

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lldb/tools/debugserver/source/RNBRemote.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,9 @@ rnb_err_t RNBRemote::HandlePacket_qLaunchSuccess(const char *p) {
16431643
return SendPacket("OK");
16441644
std::ostringstream ret_str;
16451645
std::string status_str;
1646-
ret_str << "E" << m_ctx.LaunchStatusAsString(status_str);
1646+
std::string error_quoted = binary_encode_string
1647+
(m_ctx.LaunchStatusAsString(status_str));
1648+
ret_str << "E" << error_quoted;
16471649

16481650
return SendPacket(ret_str.str());
16491651
}
@@ -2677,8 +2679,9 @@ std::string cstring_to_asciihex_string(const char *str) {
26772679
std::string hex_str;
26782680
hex_str.reserve (strlen (str) * 2);
26792681
while (str && *str) {
2682+
uint8_t c = *str++;
26802683
char hexbuf[5];
2681-
snprintf (hexbuf, sizeof(hexbuf), "%02x", *str++);
2684+
snprintf (hexbuf, sizeof(hexbuf), "%02x", c);
26822685
hex_str += hexbuf;
26832686
}
26842687
return hex_str;

0 commit comments

Comments
 (0)