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

LUA: make one byte room for the nul terminator after iconv()

parent 78d1d110
...@@ -128,8 +128,8 @@ static int vlclua_iconv( lua_State *L ) ...@@ -128,8 +128,8 @@ static int vlclua_iconv( lua_State *L )
if( iconv_handle == (vlc_iconv_t)-1 ) if( iconv_handle == (vlc_iconv_t)-1 )
return vlclua_error( L ); return vlclua_error( L );
psz_output = psz_original = malloc( 4 * i_in_bytes );
i_out_bytes = 4 * i_in_bytes; i_out_bytes = 4 * i_in_bytes;
psz_output = psz_original = malloc( i_out_bytes + 1 );
i_ret = vlc_iconv( iconv_handle, &psz_input , i_ret = vlc_iconv( iconv_handle, &psz_input ,
&i_in_bytes, &psz_output, &i_out_bytes ); &i_in_bytes, &psz_output, &i_out_bytes );
*psz_output = '\0'; *psz_output = '\0';
......
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