This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Updated [test]: coreutils-8.24-2


On 08/26/2015 04:50 PM, Fergus wrote:
>> .. No, you're the first to report it (so 8.24-2 has the same issue), but
>> now that I know about it, it will get fixed soon.

Spot the bugs:

int
cygwin_spelling (char const *path)
{
...
  int len;
...
  if (! path || ! *path || len > PATH_MAX)
    /* PATH will cause EINVAL or ENAMETOOLONG, treat it as non-existing.  */
    return -1;
  len = strlen (path);


D'oh. But this same flub of mine was also present in at least 8.23-4; so
it was the upstream churn in src/cp.c that caused the stack to be
different to the point that it now matters.

[For those keeping score, I should use size_t and not int to store
strlen() values, since it matters on 64-bit when encountering the
unlikely >2G string; and it helps to never branch on uninitialized memory]

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]