bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #57014] make-4.2.91 segfaults under Solaris 10 when many files are


From: anonymous
Subject: [bug #57014] make-4.2.91 segfaults under Solaris 10 when many files are involved
Date: Tue, 8 Oct 2019 07:21:36 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #3, bug #57014 (project make):

Please have a look into src/hash.c, in sum_up_to_nul(). The memcpy() (line
416) segfaults because the bytes after \0 are not readable, in the case where
the filename (or whatever is hashed here) ends immediately (or almost
immediately) before the boundary.

I replaced 'memcpy(&val, (p), 4);' with

val = 0;
if (p[0] == 0) {
  memcpy(&val, (p), 1);
} else if (p[1] == 0) {
  memcpy(&val, (p), 2);
} else if (p[2] == 0) {
  memcpy(&val, (p), 3);
} else {
  memcpy(&val, (p), 4);
};

with success.

Another solution is to always manage 3 bytes after \0 for the hashed strings.

I suppose this sheds some (more) light on the subject.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57014>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]