[libdvdnav-devel] [Git][videolan/libdvdread][master] Use strcpy instead of sprintf to copy strings

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Aug 11 20:25:34 UTC 2026



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread


Commits:
d0a7af10 by Petri Hintukainen at 2026-08-11T22:24:40+02:00
Use strcpy instead of sprintf to copy strings

- - - - -


1 changed file:

- src/dvd_reader.c


Changes:

=====================================
src/dvd_reader.c
=====================================
@@ -1115,7 +1115,7 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *ctx, int title, int menu,
     return NULL;
 
   if ( ts_type == DVD_VR ) {
-    sprintf( filename, "/DVD_RTAV/VR_MOVIE.VRO" );
+    strcpy( filename, "/DVD_RTAV/VR_MOVIE.VRO" );
   } else if( title == 0 ) {
     sprintf( filename, "/%s_TS/%s_TS.VOB", DVD_TYPE_STRING( ts_type ), DVD_TYPE_STRING( ts_type ) );
   } else if(!menu) {
@@ -1128,7 +1128,7 @@ static dvd_file_t *DVDOpenVOBUDF( dvd_reader_t *ctx, int title, int menu,
       sprintf( filename, "/VIDEO_TS/VTS_%02d_0.VOB", title );
     else if ( ts_type == DVD_A )
       /* DVD_Audio title menu */
-      sprintf( filename, "/AUDIO_TS/AUDIO_SV.VOB" );
+      strcpy( filename, "/AUDIO_TS/AUDIO_SV.VOB" );
   }
 
   start = UDFFindFile( ctx, filename, &len );
@@ -1211,7 +1211,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *ctx, int title, int menu,
         sprintf( filename, "VTS_%02i_0.VOB", title );
       else
         /* Remaining title menus would be in the still videos VOB */
-        sprintf( filename, "AUDIO_SV.VOB" );
+        strcpy( filename, "AUDIO_SV.VOB" );
     }
     if( !findDVDFile( ctx, filename, full_path ) ) {
       free( dvd_file );
@@ -1241,7 +1241,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *ctx, int title, int menu,
     /* DVD-VR uses UDF 2.0 which allows for larger file sizes, 1GB limit does not exist */
     /* will only return one file, treating it as a single fragment with one title dev */
     if ( ts_type == DVD_VR ) {
-      sprintf( filename, "VR_MOVIE.VRO");
+      strcpy( filename, "VR_MOVIE.VRO");
 
       if( !findDVDFile( ctx, filename, full_path ) ) {
         free( dvd_file );
@@ -1393,7 +1393,7 @@ dvd_file_t *DVDOpenFile( dvd_reader_t *ctx, int titlenum,
   switch( domain ) {
   case DVD_READ_INFO_FILE:
     if ( ctx->dvd_type == DVD_VR )
-      sprintf( filename, "/DVD_RTAV/VR_MANGR.IFO" );
+      strcpy( filename, "/DVD_RTAV/VR_MANGR.IFO" );
     else if( titlenum == 0 ) {
       sprintf( filename, "/%s_TS/%s_TS.IFO", DVD_TYPE_STRING( ctx->dvd_type ),
               DVD_TYPE_STRING( ctx->dvd_type ) );
@@ -1405,7 +1405,7 @@ dvd_file_t *DVDOpenFile( dvd_reader_t *ctx, int titlenum,
     break;
   case DVD_READ_INFO_BACKUP_FILE:
     if ( ctx->dvd_type == DVD_VR )
-      sprintf( filename, "/DVD_RTAV/VR_MANGR.BUP" );
+      strcpy( filename, "/DVD_RTAV/VR_MANGR.BUP" );
     else if( titlenum == 0 ) {
       sprintf( filename,  "/%s_TS/%s_TS.BUP", DVD_TYPE_STRING( ctx->dvd_type ),
               DVD_TYPE_STRING( ctx->dvd_type ) );



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/d0a7af101672608e803b07288f155956214a1815

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/d0a7af101672608e803b07288f155956214a1815
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list