Skip to content

Commit ef12e43

Browse files
authored
Fix reading past the end of an allocated buffer. (#15713)
title_length is originally calculated to be the msg length, but later if the task has a title then that is used instead, but the length is not updated. If msg is longer than title, we read past the end of the buffer.
1 parent f33f5e2 commit ef12e43

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

gfx/gfx_widgets.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ void gfx_widgets_msg_queue_push(
243243
{
244244
title = msg_widget->msg = strdup(task->title);
245245
msg_widget->msg_new = strdup(title);
246+
title_length = strlen(title);
246247
msg_widget->msg_len = title_length;
247248

248249
if (!string_is_empty(task->error))

0 commit comments

Comments
 (0)