From 7ae03d031828b8595ef6a441717b3b5402f6ce0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Wed, 13 Jun 2007 16:45:32 +0200 Subject: Use strndup rather than just strdup to avoid overflows. --- src/combined/nsf_demuxer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/combined/nsf_demuxer.c b/src/combined/nsf_demuxer.c index c00f9c4e2..71e4b2c78 100644 --- a/src/combined/nsf_demuxer.c +++ b/src/combined/nsf_demuxer.c @@ -105,9 +105,9 @@ static int open_nsf_file(demux_nsf_t *this) { this->total_songs = header[6]; this->current_song = header[7]; - this->title = strdup(&header[0x0E]); - this->artist = strdup(&header[0x2E]); - this->copyright = strdup(&header[0x4E]); + this->title = strndup((char*)&header[0x0E], 0x20); + this->artist = strndup((char*)&header[0x2E], 0x20); + this->copyright = strndup((char*)&header[0x4E], 0x20); this->filesize = this->input->get_length(this->input); -- cgit v1.2.3