[vlc-commits] [Git][videolan/vlc][3.0.x] 2 commits: vcd: cdrom: add missing allocation check

François Cartegnie (@fcartegnie) gitlab at videolan.org
Tue Sep 1 08:34:00 UTC 2026



François Cartegnie pushed to branch 3.0.x at VideoLAN / VLC


Commits:
689c16a7 by Alexandre Janniaux at 2026-09-01T08:40:26+02:00
vcd: cdrom: add missing allocation check

(cherry picked from commit 5a42e03e46853bdf8c6c35be533d3644b4a08068)

- - - - -
5c5212f0 by François Cartegnie at 2026-09-01T08:40:26+02:00
access: cdrom: check strdup

(cherry picked from commit 0d70243ef4f9891524dc98728406831b4f790dd4)

- - - - -


1 changed file:

- modules/access/vcd/cdrom.c


Changes:

=====================================
modules/access/vcd/cdrom.c
=====================================
@@ -878,9 +878,23 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
                     {
                         psz_vcdfile = malloc( strlen(filename) +
                                       (p_pos - psz_cuefile + 1) + 1 );
+                        if (psz_vcdfile == NULL)
+                        {
+                            i_ret = VLC_ENOMEM;
+                            goto error;
+                        }
                         strncpy( psz_vcdfile, psz_cuefile, (p_pos - psz_cuefile + 1) );
                         strcpy( psz_vcdfile + (p_pos - psz_cuefile + 1), filename );
-                    } else psz_vcdfile = strdup( filename );
+                    }
+                    else
+                    {
+                        psz_vcdfile = strdup( filename );
+                        if( psz_vcdfile == NULL )
+                        {
+                            i_ret = VLC_ENOMEM;
+                            goto error;
+                        }
+                    }
                     msg_Dbg( p_this,"using vcd image file: %s", psz_vcdfile );
                     p_vcddev->i_vcdimage_handle = vlc_open( psz_vcdfile,
                                         O_RDONLY | O_NONBLOCK | O_BINARY );
@@ -1454,4 +1468,3 @@ int ioctl_GetCdText( vlc_object_t *p_object, const vcddev_t *p_vcddev,
     free( p_text );
     return 0;
 }
-



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/04955c76b15d4cae13f1c16e508b2fe91893e041...5c5212f01b69f5fdd85f672d0cadc7fffb97379b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/04955c76b15d4cae13f1c16e508b2fe91893e041...5c5212f01b69f5fdd85f672d0cadc7fffb97379b
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 vlc-commits mailing list