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 @@
* Copyright (C) 2001 the VideoLAN team
* $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
* 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 )
}
if( p_playlist->status.i_status == PLAYLIST_STOPPED )
{
psz_display = (char *)malloc( sizeof(char )*strlen(_("Stop")));
sprintf( psz_display,_("Stop") );
psz_display = strdup(_("Stop"));
vlc_object_release( p_playlist );
}
else if( p_playlist->status.i_status == PLAYLIST_PAUSED )
{
psz_display = (char *)malloc( sizeof(char )*strlen(_("Pause")));
sprintf( psz_display,_("Pause") );
psz_display = strdup(_("Pause"));
vlc_object_release( p_playlist );
}
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