Commit f62ada21 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use strdup() instead of malloc()/sprintf(), and fix off-by-one overflow

Please test.
parent ed7d4688
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Copyright (C) 2001 the VideoLAN team * Copyright (C) 2001 the VideoLAN team
* $Id$ * $Id$
* *
* Authors: Loc Minier <lool@videolan.org> * Authors: Loïc Minier <lool@videolan.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -232,14 +232,12 @@ static void Run( intf_thread_t *p_intf ) ...@@ -232,14 +232,12 @@ static void Run( intf_thread_t *p_intf )
} }
if( p_playlist->status.i_status == PLAYLIST_STOPPED ) if( p_playlist->status.i_status == PLAYLIST_STOPPED )
{ {
psz_display = (char *)malloc( sizeof(char )*strlen(_("Stop"))); psz_display = strdup(_("Stop"));
sprintf( psz_display,_("Stop") );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
else if( p_playlist->status.i_status == PLAYLIST_PAUSED ) else if( p_playlist->status.i_status == PLAYLIST_PAUSED )
{ {
psz_display = (char *)malloc( sizeof(char )*strlen(_("Pause"))); psz_display = strdup(_("Pause"));
sprintf( psz_display,_("Pause") );
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment