[vlc-commits] [Git][videolan/vlc][master] access: cdrom: check strdup

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu Apr 9 17:40:31 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
0d70243e by François Cartegnie at 2026-04-09T16:29:13+00:00
access: cdrom: check strdup

- - - - -


1 changed file:

- modules/access/vcd/cdrom.c


Changes:

=====================================
modules/access/vcd/cdrom.c
=====================================
@@ -871,7 +871,16 @@ static int OpenVCDImage( vlc_object_t * p_this, const char *psz_dev,
                         }
                         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 );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0d70243ef4f9891524dc98728406831b4f790dd4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/0d70243ef4f9891524dc98728406831b4f790dd4
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list