Buffer overflow from OpenBSD:
Rev 1.3 millert: Fix potential buf oflow wrt strerror and sprintf. Obtained from: OpenBSD
This commit is contained in:
parent
87751a8467
commit
c50189d7ba
@ -244,6 +244,6 @@ error(num)
|
|||||||
{
|
{
|
||||||
|
|
||||||
DEBUG2("rmtd: E %d (%s)\n", num, strerror(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));
|
(void)write(1, resp, strlen(resp));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user