summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bb45c03)
Found by Coverity:
CID
1243016 (#1 of 1): Buffer not null terminated
(BUFFER_SIZE_WARNING)14. buffer_size_warning: Calling strncpy with a
maximum size argument of 256 bytes on destination array msg.name of size
256 bytes might leave the destination string unterminated.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
app->pid, app->sock->fd);
data_size = sizeof(msg);
app->pid, app->sock->fd);
data_size = sizeof(msg);
+ memset(&msg, 0, sizeof(msg));
+ if (lttng_strncpy(msg.name, event->name, sizeof(msg.name))) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
ret = send_header(app->sock, data_size, AGENT_CMD_DISABLE, 0);
if (ret < 0) {
goto error_io;
}
ret = send_header(app->sock, data_size, AGENT_CMD_DISABLE, 0);
if (ret < 0) {
goto error_io;
}
- memset(&msg, 0, sizeof(msg));
- strncpy(msg.name, event->name, sizeof(msg.name));
ret = send_payload(app->sock, &msg, sizeof(msg));
if (ret < 0) {
goto error_io;
ret = send_payload(app->sock, &msg, sizeof(msg));
if (ret < 0) {
goto error_io;