Update to FreeBSD head 2019-09-24

Git mirror commit 6b0307a0a5184339393f555d5d424190d8a8277a.
This commit is contained in:
Sebastian Huber
2019-09-24 11:05:03 +02:00
parent 83afe13399
commit a5ddb0ea69
903 changed files with 39332 additions and 17958 deletions

View File

@@ -60,7 +60,7 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he,
char *cp, **q;
char *result;
int resultlen, size, addrok = 0;
char ypbuf[YPMAXRECORD + 2];
char *ypbuf;
res_state statp;
statp = __res_state();
@@ -90,10 +90,11 @@ _gethostbynis(const char *name, char *map, int af, struct hostent *he,
}
/* avoid potential memory leak */
bcopy((char *)result, (char *)&ypbuf, resultlen);
ypbuf = alloca(resultlen + 2);
bcopy(result, ypbuf, resultlen);
ypbuf[resultlen] = '\0';
free(result);
result = (char *)&ypbuf;
result = ypbuf;
if ((cp = strchr(result, '\n')))
*cp = '\0';