summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-06-13 16:45:32 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-06-13 16:45:32 +0200
commit7ae03d031828b8595ef6a441717b3b5402f6ce0d (patch)
tree3188f1835dddf2c5f55d82bfe92728c2f8582a96
parent29e50bbcfef74c9edb9485d70be7f3af931ff137 (diff)
downloadxine-lib-7ae03d031828b8595ef6a441717b3b5402f6ce0d.tar.gz
xine-lib-7ae03d031828b8595ef6a441717b3b5402f6ce0d.tar.bz2
Use strndup rather than just strdup to avoid overflows.
-rw-r--r--src/combined/nsf_demuxer.c6
1 files changed, 3 insertions, 3 deletions
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);