Commit dff08f1b authored by Erik de Castro Lopo's avatar Erik de Castro Lopo
Browse files

Fix buffer overflow by replacing strcpy with memcpy.

Thanks to Cristian Rodríguez <crrodriguez@opensuse.org> for the
report.
parent 6c2040dc
......@@ -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);
......
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