Changeset f62ada21e1e0a59b9ac8c715387a561c5b580578

Show
Ignore:
Timestamp:
11/28/05 10:26:56 (3 years ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1133170016 +0000
git-parent:

[ed7d46886576b5e1419b3222433f12bcf1fe702d]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1133170016 +0000
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/visualization/xosd.c

    r64595f0 rf62ada2  
    55 * $Id$ 
    66 * 
    7  * Authors: LoMinier <lool@videolan.org> 
     7 * Authors: Loïc Minier <lool@videolan.org> 
    88 * 
    99 * This program is free software; you can redistribute it and/or modify 
     
    233233            if( p_playlist->status.i_status == PLAYLIST_STOPPED ) 
    234234            { 
    235                 psz_display = (char *)malloc( sizeof(char )*strlen(_("Stop"))); 
    236                 sprintf( psz_display,_("Stop") ); 
     235                psz_display = strdup(_("Stop")); 
    237236                vlc_object_release( p_playlist ); 
    238237            } 
    239238            else if( p_playlist->status.i_status == PLAYLIST_PAUSED ) 
    240239            { 
    241                 psz_display = (char *)malloc( sizeof(char )*strlen(_("Pause"))); 
    242                 sprintf( psz_display,_("Pause") ); 
     240                psz_display = strdup(_("Pause")); 
    243241                vlc_object_release( p_playlist ); 
    244242            }