From f834d9a8a46a8d3edfea5ea1c9ee66177dee7b04 Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Thu, 1 Jan 2009 19:25:07 +0100 Subject: 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. --- src/libsputext/demux_sputext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index 3e9efb079..198c30498 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -147,7 +147,7 @@ static inline void trail_space(char *s) { 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"); -- cgit v1.2.3