summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2000-08-23 08:54:22 +0000
committerKris Kennaway <kris@FreeBSD.org>2000-08-23 08:54:22 +0000
commitd0421f95ba23d408bbcd7837557485f6edbd77bc (patch)
tree69d17aeee0ee7f3ac57eac7f3c03a47ee8a3768e
parentb4a6efd3a5cb7af08a0a9fdffe8f0a6ef085cbd6 (diff)
Notes
-rw-r--r--lib/libcompat/4.3/rexec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libcompat/4.3/rexec.c b/lib/libcompat/4.3/rexec.c
index beb210832993..2fc85dad9b84 100644
--- a/lib/libcompat/4.3/rexec.c
+++ b/lib/libcompat/4.3/rexec.c
@@ -29,6 +29,8 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
+ *
+ * $FreeBSD$
*/
#if defined(LIBC_SCCS) && !defined(lint)
@@ -146,6 +148,8 @@ ruserpass(host, aname, apass, aacct)
hdir = getenv("HOME");
if (hdir == NULL)
hdir = ".";
+ if (strlen(hdir) + 8 > sizeof(buf))
+ return (0);
(void) sprintf(buf, "%s/.netrc", hdir);
cfile = fopen(buf, "r");
if (cfile == NULL) {