Update to FreeBSD stable/12 2019-09-23

Git mirror commit 7e8d1444023128d34fb9aa4e4515928a4f794d1b.
This commit is contained in:
Sebastian Huber
2019-09-23 12:49:10 +02:00
parent d06c638d7b
commit 37323bb819
304 changed files with 5700 additions and 2243 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';