131-inet-fix-__read_etc_hosts_r-segfault.patch 292 B

12345678910
  1. --- a/libc/inet/resolv.c
  2. +++ b/libc/inet/resolv.c
  3. @@ -1631,6 +1631,7 @@ int attribute_hidden __read_etc_hosts_r(
  4. * struct in[6]_addr
  5. * char line_buffer[BUFSZ+];
  6. */
  7. + memset(buf, 0, buflen);
  8. parser->data = buf;
  9. parser->data_len = aliaslen;
  10. parser->line_len = buflen - aliaslen;