]> git.sur5r.net Git - openocd/commit
svf: off-by-one error; do not access after the allocated memory
authorPaul Fertser <fercerpav@gmail.com>
Tue, 10 Sep 2013 11:14:56 +0000 (15:14 +0400)
committerSpencer Oliver <spen@spen-soft.co.uk>
Fri, 13 Sep 2013 19:34:46 +0000 (19:34 +0000)
commit8b3f0f3f69a393151252d7f2211c9a15ae6cb456
tree7d0bdfb51f1ab7133b154584cbb47a5da23d21e3
parent3377c164204f8cdaeabdbba13513091b5e04fce0
svf: off-by-one error; do not access after the allocated memory

Keep the promise and ensure there're at least 3 bytes available after
the current position.

This eliminates the errors reported by Valgrind.

Change-Id: I1d0640e904c750eed808b2b4caf419b4d7619845
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/1615
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
src/svf/svf.c