[MPlayer-dev-eng] Re: [PATCH] fix for unconditional use of PATH_MAX

Tobias Diedrich ranma at gmx.at
Tue Apr 29 18:17:34 CEST 2003


Robert Millan wrote:

> consider the following call in mplayer.c:
> 
> char cwd[PATH_MAX+2]
> [...]
> getcwd(cwd, PATH_MAX)
> 
> If you hardcode PATH_MAX to, say 512, you'd be declaring a 512-byte
> buffer and telling getcwd to write the current path to it. If the
> current path is longer than 512, we're dead. mplayer would crash on

No, the above code would declare a 514 byte buffer and getcwd would
write at most 512 bytes because of the size parameter. If it does not
honor that, than it's a bug of your libc.

-- 
Tobias						PGP: http://9ac7e0bc.2ya.com
This mail is made of 100% recycled bits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030429/a8915f19/attachment.pgp>


More information about the MPlayer-dev-eng mailing list