From: Matthias H. <mh...@su...> - 2009-01-07 16:39:59
|
# HG changeset patch # User Matthias Hopf <mh...@su...> # Date 1230834307 -3600 # Node ID f0a755a6d529dfcce92b0a7e63f072cd2568dfd3 # Parent 9f367688cc08e9cf9e5a2a9b48869eb80c5effec check length parameter against buffer length in libsputext read_line_from_input Currently, this is satisfied in all locations where it is called, but it is more prudent to add the check. diff -r f0a755a6d529dfcce92b0a7e63f072cd2568dfd3 -r 9f367688cc08e9cf9e5a2a9b48869eb80c5effec src/libsputext/demux_sputext.c --- a/src/libsputext/demux_sputext.c Thu Jan 01 19:25:07 2009 +0100 +++ b/src/libsputext/demux_sputext.c Thu Jan 01 01:45:15 2009 +0100 @@ -147,7 +147,7 @@ static char *read_line_from_input(demux_ static char *read_line_from_input(demux_sputext_t *this, char *line, off_t len) { off_t nread = 0; - if ((len - this->buflen) > 512) { + if ((len - this->buflen) > 512 && len < SUB_BUFSIZE) { if((nread = this->input->read(this->input, &this->buf[this->buflen], len - this->buflen)) < 0) { xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "read failed.\n"); |