summaryrefslogtreecommitdiff
path: root/src
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
commitcbc85406d8e3c86c48f5b162881fa10c95e675ec (patch)
treec620a4be237cb65daa7daa6507b41f6546ff89ea /src
parentc440431caef75667ce807f49ec72e029d7e5037f (diff)
downloadxine-lib-cbc85406d8e3c86c48f5b162881fa10c95e675ec.tar.gz
xine-lib-cbc85406d8e3c86c48f5b162881fa10c95e675ec.tar.bz2
Use strndup rather than just strdup to avoid overflows.
(transplanted from 47f7f33b32805da6e8f58513c38e01dc6a595fb8) --HG-- extra : transplant_source : G%F7%F3%3B2%80%5D%A6%E8%F5%85%13%C3%8E%01%DCjY_%B8
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_nsf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c
index 81f42044f..d81010846 100644
--- a/src/demuxers/demux_nsf.c
+++ b/src/demuxers/demux_nsf.c
@@ -106,9 +106,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);