# HG changeset patch # User nicodvb # Date 1208598255 0 # Node ID f08dbb15ece14cdb5537b14f431ecc68c6ca4982 # Parent 63aad8298f28f04aff14cf154d37ecab4f979bd2 in dvdnav_open() make sure to NULL-terminate this->path and to not overrun its length; patch by Erik Hovland - erik hovland org diff -r 63aad8298f28 -r f08dbb15ece1 dvdnav.c --- a/dvdnav.c Sat Apr 19 09:40:03 2008 +0000 +++ b/dvdnav.c Sat Apr 19 09:44:15 2008 +0000 @@ -108,7 +108,8 @@ } /* Set the path. FIXME: Is a deep copy 'right' */ - strncpy(this->path, path, MAX_PATH_LEN); + strncpy(this->path, path, MAX_PATH_LEN - 1); + this->path[MAX_PATH_LEN - 1] = '\0'; /* Pre-open and close a file so that the CSS-keys are cached. */ this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS);