Type-o, change from[...] = 0 to fromb[...] = 0. The incorrect buffer

was having its last element zero'd.  It turns out not to be a security
    hole or to have any real effect on the code because 'from' was previously
    pointing to a buffer of the same size as 'fromb', and the last
    element in fromb is already 0 anyway due to the use of sizeof(fromb)-1
    in the strncpy() call.  But I'm not pressing my luck so only the type-o
    is being fixed.
This commit is contained in:
Matthew Dillon 2000-01-25 01:51:21 +00:00
parent 5bc2f0f789
commit b2dc65a8d3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=56568

View File

@ -590,7 +590,7 @@ chkhost(f)
inet_ntoa(f->sin_addr));
(void) strncpy(fromb, hp->h_name, sizeof(fromb) - 1);
from[sizeof(fromb) - 1] = '\0';
fromb[sizeof(fromb) - 1] = '\0';
from = fromb;
/* Check for spoof, ala rlogind */