Skip to content

Commit dfcf02b

Browse files
Eugene Ostroukhovofrobots
Eugene Ostroukhov
authored andcommitted
inspector: fix coverity scan errors
PR-URL: #7324 Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com> Reviewed-By: ofrobots - Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
1 parent 81b6882 commit dfcf02b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/inspector_agent.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ void SendTargentsListResponse(inspector_socket_t* socket, int port) {
110110
char buffer[sizeof(LIST_RESPONSE_TEMPLATE) + 4096];
111111
char title[2048]; // uv_get_process_title trims the title if too long
112112
int err = uv_get_process_title(title, sizeof(title));
113-
ASSERT_EQ(0, err);
113+
if (err != 0) {
114+
snprintf(title, sizeof(title), "Node.js");
115+
}
114116
char* c = title;
115-
while (!c) {
117+
while (*c != '\0') {
116118
if (*c < ' ' || *c == '\"') {
117119
*c = '_';
118120
}
@@ -322,6 +324,8 @@ AgentImpl::AgentImpl(Environment* env) : port_(0),
322324
int err;
323325
err = uv_sem_init(&start_sem_, 0);
324326
CHECK_EQ(err, 0);
327+
memset(&data_written_, 0, sizeof(data_written_));
328+
memset(&io_thread_req_, 0, sizeof(io_thread_req_));
325329
}
326330

327331
AgentImpl::~AgentImpl() {

0 commit comments

Comments
 (0)