Skip to content

Commit

Permalink
client API: fix log buffer overflow case
Browse files Browse the repository at this point in the history
It just crashed. The prefix and text fields point to static strings in
this case. Oops.

Fixes the issue mentioned in #838.
  • Loading branch information
wm4 committed Jan 13, 2015
1 parent 53a5923 commit 9418f88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions player/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,13 +751,13 @@ mpv_event *mpv_wait_event(mpv_handle *ctx, double timeout)
event->event_id = MPV_EVENT_LOG_MESSAGE;
struct mpv_event_log_message *cmsg = talloc_ptrtype(event, cmsg);
*cmsg = (struct mpv_event_log_message){
.prefix = talloc_steal(event, msg->prefix),
.prefix = msg->prefix,
.level = mp_log_levels[msg->level],
.log_level = mp_mpv_log_levels[msg->level],
.text = talloc_steal(event, msg->text),
.text = msg->text,
};
talloc_steal(event, msg);
event->data = cmsg;
talloc_free(msg);
break;
}
}
Expand Down

0 comments on commit 9418f88

Please sign in to comment.