Fix possible readlink() buffer overflow
commit5db5341debbfb1230dd7cbff970079790b5e6281
authorThomas Jarosch <tomj@simonv.com>
Tue, 15 Jan 2013 21:04:18 +0000 (15 22:04 +0100)
committerThomas Jarosch <tomj@simonv.com>
Tue, 15 Jan 2013 21:04:18 +0000 (15 22:04 +0100)
tree3d0a717ce81b4c958b4e68096079aba687974761
parent224c6d68f1e7ec889dc6c26e3eec45a65d643421
Fix possible readlink() buffer overflow

readlink() might return the full size of the target buffer
and we write a '\0' to the returned length offset.

cppecheck reported:
[rockbox/apps/tagcache.c:4335]: (warning, inconclusive) readlink() might return the full size of 'target'. Lower the supplied size by one.

(the check was actually written by me)

Change-Id: Ibb42f732aa42c38bb6cb92cdccd3e6a0d3aa9b9f
apps/tagcache.c