[Bug 74313] [patch] Fix build on Hurd without PATH_MAX

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sat Feb 1 03:40:47 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=74313

Emilio Pozuelo Monfort <pochu27 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pochu27 at gmail.com

--- Comment #1 from Emilio Pozuelo Monfort <pochu27 at gmail.com> ---
         snprintf(buf, sizeof(buf), "PATH=%s", getenv("PATH"));

Won't this just write up to sizeof(buf) bytes, that is, up to sizeof(char *),
which is normally 4 or 8 bytes? I think you want to change sizeof(buf) with
strlen(getenv("PATH"))+6 (ideally caching the result in a new len variable to
avoid doing that calculation twice).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-bugs/attachments/20140201/a065c752/attachment.html>


More information about the spice-bugs mailing list