Merge pull request #155 from ajaissle/patch-1
Prevent possible buffer overflow in iperf_error.c
(cherry picked from commit 13b65724fb
)
Signed-off-by: Bruce A. Mah <bmah@es.net>
This commit is contained in:
parent
b95bf6cbc1
commit
ec79edbf82
@ -301,11 +301,11 @@ iperf_strerror(int i_errno)
|
||||
}
|
||||
|
||||
if (herr || perr)
|
||||
strncat(errstr, ": ", len);
|
||||
strncat(errstr, ": ", sizeof(errstr)-strlen(errstr)-1);
|
||||
if (h_errno && herr) {
|
||||
strncat(errstr, hstrerror(h_errno), len);
|
||||
strncat(errstr, hstrerror(h_errno), sizeof(errstr)-strlen(errstr)-1);
|
||||
} else if (errno && perr) {
|
||||
strncat(errstr, strerror(errno), len);
|
||||
strncat(errstr, strerror(errno), sizeof(errstr)-strlen(errstr)-1);
|
||||
}
|
||||
|
||||
return errstr;
|
||||
|
Loading…
Reference in New Issue
Block a user