Buffer overflow from OpenBSD:

Rev 1.3 millert:
	Fix potential buf oflow wrt strerror and sprintf.
Obtained from: OpenBSD
This commit is contained in:
Warner Losh 1997-02-09 05:09:05 +00:00
parent 87751a8467
commit c50189d7ba
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=22464

View File

@ -244,6 +244,6 @@ error(num)
{
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
(void)sprintf(resp, "E%d\n%s\n", num, strerror(num));
(void)snprintf(resp, sizeof(resp), "E%d\n%s\n", num, strerror(num));
(void)write(1, resp, strlen(resp));
}