Re: [PATCH] install: add -C option to install file only when necessary
From:
Eric Blake
Subject:
Re: [PATCH] install: add -C option to install file only when necessary
Date:
Mon, 16 Feb 2009 05:56:29 -0700
User-agent:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.666
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to PƔdraig Brady on 2/16/2009 3:07 AM:
>> +static bool
>> +have_same_content (int a_fd, int b_fd)
>> +{
>> +#define CMP_BLOCK_SIZE 65536
>> + char a_buff[CMP_BLOCK_SIZE];
>> + char b_buff[CMP_BLOCK_SIZE];
>
> Is 128KiB of stack OK?
In general, no. That is too likely to trigger stack overflow without
looking like stack overflow. In general, any more than 4k stack
allocation in a single function is likely to cause problems. I would feel
safer if this used malloc or static storage.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmZYn0ACgkQ84KuGfSFAYDSwACgnfmLWm69w5gqhvTc005sw9tG
OFUAoIYHHWpyjBVR4qP/UkSDXR7omiOY
=yIzh
-----END PGP SIGNATURE-----