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 | 97853bac963c5d3bed1b2cc8456b52dc100a3a16 (patch) | |
tree | 2164c380c4cbce635871c28ad6025cf3001cedaa /contrib/sendmail/libsm/memstat.c | |
parent | a26ee9422b3dd49a0146ab2eec3f21acf30e399c (diff) | |
parent | 14e22b52d4375b164f9fa21c0ab3abd9837e823f (diff) | |
download | FreeBSD-src-97853bac963c5d3bed1b2cc8456b52dc100a3a16.zip FreeBSD-src-97853bac963c5d3bed1b2cc8456b52dc100a3a16.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r168515,
which included commits to RCS files with non-trunk default branches.
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] == ':') |