comparison dvdnav.c @ 337:f08dbb15ece1 src

in dvdnav_open() make sure to NULL-terminate this->path and to not overrun its length; patch by Erik Hovland - erik hovland org
author nicodvb
date Sat, 19 Apr 2008 09:44:15 +0000
parents cbd2b606f343
children 0dc09442ff9c
comparison
equal deleted inserted replaced
336:63aad8298f28 337:f08dbb15ece1
106 free(this); 106 free(this);
107 return DVDNAV_STATUS_ERR; 107 return DVDNAV_STATUS_ERR;
108 } 108 }
109 109
110 /* Set the path. FIXME: Is a deep copy 'right' */ 110 /* Set the path. FIXME: Is a deep copy 'right' */
111 strncpy(this->path, path, MAX_PATH_LEN); 111 strncpy(this->path, path, MAX_PATH_LEN - 1);
112 this->path[MAX_PATH_LEN - 1] = '\0';
112 113
113 /* Pre-open and close a file so that the CSS-keys are cached. */ 114 /* Pre-open and close a file so that the CSS-keys are cached. */
114 this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS); 115 this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS);
115 116
116 /* Start the read-ahead cache. */ 117 /* Start the read-ahead cache. */