Skip to content

Commit e855f62

Browse files
bwardenFlole998
authored andcommitted
Use safer htsmsg_add_str2 when copying de->de_directory
de->de_directory may be null. htsmsg_add_str passes str unchecked to underlying strlen function. __strlen_avx2 will segfault if str is null. htsmsg_add_str2 checks the value of args before passing them to htsmsg_add_str, which should prevent this. Fixes #1712
1 parent 366e562 commit e855f62

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/dvr/dvr_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1480,7 +1480,7 @@ dvr_entry_rerecord(dvr_entry_t *de)
14801480
htsmsg_add_str2(conf, "owner", de->de_owner);
14811481
htsmsg_add_str2(conf, "creator", de->de_creator);
14821482
htsmsg_add_str(conf, "comment", buf);
1483-
htsmsg_add_str(conf, "directory", de->de_directory);
1483+
htsmsg_add_str2(conf, "directory", de->de_directory);
14841484
de2 = dvr_entry_create_from_htsmsg(conf, e);
14851485
htsmsg_destroy(conf);
14861486

0 commit comments

Comments
 (0)