comedi_test: Fix buffer overrun in test_mmap()
authorIan Abbott <abbotti@mev.co.uk>
Mon, 27 Jun 2011 12:03:03 +0000 (13:03 +0100)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 27 Jun 2011 12:03:03 +0000 (13:03 +0100)
commit261d3e102945bf1389360bf5fb19142c9453f491
treef79d6e6456ac2bd1cac96edbab68bd5d4d003005
parentcceb2bc2500368ca4e2cf1a737d34330083fb58a
comedi_test: Fix buffer overrun in test_mmap()

If the command does not stop immediately after the last sample, there
can be more data to read than we have room for.  Make sure the 'while'
loop 'read()' does not overrun the end of the malloc'ed 'buf'.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
testing/mmap.c