From b6e7be6a04960142182365334cc38f7f7a310d29 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Mon, 11 Feb 2019 08:08:21 -0700 Subject: [PATCH] dvdnav: fix potentially unterminated string (cherry picked from commit a54f09a9f1a292ac3b9e6699ea09d8e0239e6f7b) --- libhb/dvdnav.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libhb/dvdnav.c b/libhb/dvdnav.c index 5a3782cbb..9eb5534ed 100644 --- a/libhb/dvdnav.c +++ b/libhb/dvdnav.c @@ -457,7 +457,8 @@ static hb_title_t * hb_dvdnav_title_scan( hb_dvd_t * e, int t, uint64_t min_dura title->type = HB_DVD_TYPE; if (dvdnav_get_title_string(d->dvdnav, &name) == DVDNAV_STATUS_OK) { - strncpy( title->name, name, sizeof( title->name ) ); + strncpy(title->name, name, sizeof(title->name) - 1); + title->name[sizeof(title->name) - 1] = 0; } if (strlen(title->name) == 0) -- 2.40.0