Commit afccf904 afccf904c42d5ee7d71efd29517a4d76e2d8d28c by Sergey Poznyakoff

(header_get_field_name): Fix buffer overflow (IDEF0957).

1 parent 1917d2ee
......@@ -710,7 +710,7 @@ header_get_field_name (header_t header, size_t num, char *buf,
{
/* save one for the null */
--buflen;
len = (len > buflen) ? len : len;
len = (len > buflen) ? buflen : len;
memcpy (buf, header->hdr[num].fn, len);
buf[len] = '\0';
}
......