https://bugs.kde.org/show_bug.cgi?id=514094

--- Comment #8 from [email protected] ---
The attached patch doesn't seem quite right; it overflows the buffer if the
path doesn't fit.

In my original C code, change `readlink("/proc/self/exe", buf, 64)` to
`readlink("/proc/self/exe", buf, 5)`. I would expect to get `ret = 5, buf =
/home`, but with the patch I get `ret = 17, buf = /home/akuli/a.out`.

I think we want something like `SizeT res =
min(VG_(strlen)(VG_(resolved_exename)), ARG3)` followed by a memcpy with size
`res`.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to