Changeset e14f2110f980c64ca22d22aa667fc67c039bbccd

Show
Ignore:
Timestamp:
03/03/08 18:58:50 (9 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1204567130 +0200
git-parent:

[17291ac5f14e95b0698281ba72c0373b887aee4e]

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

Fix a bunch of format string injection in the Real RTSP access

...or why is asprintf() not the same as strdup().

Signed-off-by: Rémi Denis-Courmont <rem@videolan.org>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/demux/real.c

    r17291ac re14f211  
    818818                psz[i_len] = '\0'; 
    819819 
     820                EnsureUTF8( psz ); 
    820821                msg_Dbg( p_demux, "    - title=`%s'", psz ); 
    821                 EnsureUTF8( psz ); 
    822                 asprintf( &p_sys->psz_title, psz ); 
    823                 free( psz ); 
     822                p_sys->psz_title = psz; 
    824823                i_skip -= i_len; 
    825824            } 
     
    833832                psz[i_len] = '\0'; 
    834833 
     834                EnsureUTF8( psz ); 
    835835                msg_Dbg( p_demux, "    - author=`%s'", psz ); 
    836                 EnsureUTF8( psz ); 
    837                 asprintf( &p_sys->psz_artist, psz ); 
    838                 free( psz ); 
     836                p_sys->psz_artist = psz; 
    839837                i_skip -= i_len; 
    840838            } 
     
    848846                psz[i_len] = '\0'; 
    849847 
     848                EnsureUTF8( psz ); 
    850849                msg_Dbg( p_demux, "    - copyright=`%s'", psz ); 
    851                 EnsureUTF8( psz ); 
    852                 asprintf( &p_sys->psz_copyright, psz ); 
    853                 free( psz ); 
     850                p_sys->psz_copyright = psz; 
    854851                i_skip -= i_len; 
    855852            } 
     
    863860                psz[i_len] = '\0'; 
    864861 
     862                EnsureUTF8( psz ); 
    865863                msg_Dbg( p_demux, "    - comment=`%s'", psz ); 
    866                 EnsureUTF8( psz ); 
    867                 asprintf( &p_sys->psz_description, psz ); 
    868                 free( psz ); 
     864                p_sys->psz_description = psz; 
    869865                i_skip -= i_len; 
    870866            } 
     
    10491045                psz[i_len] = '\0'; 
    10501046 
     1047                EnsureUTF8( psz ); 
    10511048                msg_Dbg( p_demux, "    - title=`%s'", psz ); 
    1052                 EnsureUTF8( psz ); 
    1053                 asprintf( &p_sys->psz_title, psz ); 
    1054                 free( psz ); 
     1049                p_sys->psz_title = psz; 
    10551050            } 
    10561051            p_peek += i_len; 
     
    10641059                psz[i_len] = '\0'; 
    10651060 
     1061                EnsureUTF8( psz ); 
    10661062                msg_Dbg( p_demux, "    - artist=`%s'", psz ); 
    1067                 EnsureUTF8( psz ); 
    1068                 asprintf( &p_sys->psz_artist, psz ); 
    1069                 free( psz ); 
     1063                p_sys->psz_artist = psz; 
    10701064            } 
    10711065            p_peek += i_len; 
     
    10791073                psz[i_len] = '\0'; 
    10801074 
     1075                EnsureUTF8( psz ); 
    10811076                msg_Dbg( p_demux, "    - Copyright=`%s'", psz ); 
    1082                 EnsureUTF8( psz ); 
    1083                 asprintf( &p_sys->psz_copyright, psz ); 
    1084                 free( psz ); 
     1077                p_sys->psz_copyright = psz; 
    10851078            } 
    10861079            p_peek += i_len; 
     
    10941087                psz[i_len] = '\0'; 
    10951088 
     1089                EnsureUTF8( psz ); 
    10961090                msg_Dbg( p_demux, "    - Comment=`%s'", psz ); 
    1097                 EnsureUTF8( psz ); 
    1098                 asprintf( &p_sys->psz_description, psz ); 
    1099                 free( psz ); 
     1091                p_sys->psz_description = psz; 
    11001092            } 
    11011093            /* This might be unusefull */