From: Erik de Castro Lopo Date: Thu, 5 Apr 2012 11:02:40 +0000 (+1000) Subject: Fix buffer overflow by replacing strcpy with memcpy. X-Git-Tag: 1.3.0pre1~78 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dff08f1be0599cd47f47ac58ea103f4491a101e4;p=platform%2Fupstream%2Fflac.git Fix buffer overflow by replacing strcpy with memcpy. Thanks to Cristian Rodríguez for the report. --- diff --git a/src/metaflac/options.c b/src/metaflac/options.c index eb3498d..f242618 100644 --- a/src/metaflac/options.c +++ b/src/metaflac/options.c @@ -1041,7 +1041,7 @@ FLAC__bool parse_block_type(const char *in, Argument_BlockType *out) out->entries[entry].filter_application_by_id = (0 != r); if(0 != r) { if(strlen(r) == 4) { - strcpy(out->entries[entry].application_id, r); + memcpy(out->entries[entry].application_id, r, 4); } else if(strlen(r) == 10 && strncmp(r, "0x", 2) == 0 && strspn(r+2, "0123456789ABCDEFabcdef") == 8) { FLAC__uint32 x = strtoul(r+2, 0, 16);