]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/fd.cc: fix possible out-of-bounds write
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 26 Jun 2014 03:22:02 +0000 (05:22 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 26 Jun 2014 03:22:02 +0000 (05:22 +0200)
commit046c9769fc4eaffc1dd4a21b61c1c5696d537def
treeda8395a213f68cbac10bf752a31d68ee5ebcc3cc
parent605d1805692547a78beb9bf81ec8c0955b3c9274
common/fd.cc: fix possible out-of-bounds write

Read max 'sizeof(target) - 1' to not write out of bound
later on the 'target[r] = 0;' call in case we read the
full PATH_MAX.

CID 1128416 (#1 of 1): Out-of-bounds write (OVERRUN)
 overrun-local: Overrunning array target of 4096 bytes
 at byte offset 4096 using index r (which evaluates to 4096).

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/common/fd.cc