diff options
author | gshapiro <gshapiro@FreeBSD.org> | 2007-04-09 01:38:51 +0000 |
---|---|---|
committer | gshapiro <gshapiro@FreeBSD.org> | 2007-04-09 01:38:51 +0000 |
commit | 14e22b52d4375b164f9fa21c0ab3abd9837e823f (patch) | |
tree | 2a4f38ae8ba223f3bf2402f56d35c997e5af6db5 /contrib/sendmail/libsm/memstat.c | |
parent | 0a9c74f73599b0ca2981b57815b436d1f6de6191 (diff) | |
download | FreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.zip FreeBSD-src-14e22b52d4375b164f9fa21c0ab3abd9837e823f.tar.gz |
Import sendmail 8.14.1
Diffstat (limited to 'contrib/sendmail/libsm/memstat.c')
-rw-r--r-- | contrib/sendmail/libsm/memstat.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/contrib/sendmail/libsm/memstat.c b/contrib/sendmail/libsm/memstat.c index 6c2a4d1..80391d7 100644 --- a/contrib/sendmail/libsm/memstat.c +++ b/contrib/sendmail/libsm/memstat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005 Sendmail, Inc. and its suppliers. + * Copyright (c) 2005-2007 Sendmail, Inc. and its suppliers. * All rights reserved. * * By using this file, you agree to the terms and conditions set @@ -8,9 +8,10 @@ */ #include <sm/gen.h> -SM_RCSID("@(#)$Id: memstat.c,v 1.4 2005/12/10 00:38:48 ca Exp $") +SM_RCSID("@(#)$Id: memstat.c,v 1.6 2007/03/20 23:26:12 ca Exp $") #include <errno.h> +#include <sm/misc.h> #if USESWAPCTL #include <sys/stat.h> @@ -265,6 +266,8 @@ sm_memstat_get(resource, pvalue) return -1; /* try to reopen? */ rewind(fp); l = strlen(resource); + if (l >= sizeof(buf)) + return EINVAL; while (fgets(buf, sizeof(buf), fp) != NULL) { if (strncmp(buf, resource, l) == 0 && buf[l] == ':') |