[vlc-devel] [vlc-commits] acoustid: use memcpy (cid #1062538)

Rémi Denis-Courmont remi at remlab.net
Fri Oct 3 19:37:25 CEST 2014


Le vendredi 3 octobre 2014, 15:40:51 Francois Cartegnie a écrit :
> diff --git a/modules/misc/webservices/acoustid.c
> b/modules/misc/webservices/acoustid.c index f23be5a..edbe47d 100644
> --- a/modules/misc/webservices/acoustid.c
> +++ b/modules/misc/webservices/acoustid.c
> @@ -81,9 +81,9 @@ static void parse_recordings( vlc_object_t *p_obj,
> json_value *node, acoustid_re record->psz_title = strdup(
> value->u.string.ptr );
>          value = jsongetbyname( recordnode, "id" );
>          if ( value && value->type == json_string )
> -            strncpy( record->sz_musicbrainz_id, value->u.string.ptr,
> MB_ID_SIZE );
> +            memcpy( record->s_musicbrainz_id,
> value->u.string.ptr, MB_ID_SIZE ); parse_artists( jsongetbyname(
> recordnode, "artists" ), record );

So what happens if value->u.string.ptr is shorter than MB_ID_SIZE - 1 bytes?

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list