diff options
Diffstat (limited to 'usr/src/cmd/sendmail/libsm/memstat.c')
| -rw-r--r-- | usr/src/cmd/sendmail/libsm/memstat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/src/cmd/sendmail/libsm/memstat.c b/usr/src/cmd/sendmail/libsm/memstat.c index f674622742..615a5cfcb2 100644 --- a/usr/src/cmd/sendmail/libsm/memstat.c +++ b/usr/src/cmd/sendmail/libsm/memstat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006 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 @@ -10,7 +10,7 @@ #pragma ident "%Z%%M% %I% %E% SMI" #include <sm/gen.h> -SM_RCSID("@(#)$Id: memstat.c,v 1.5 2006/06/28 23:57:59 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> @@ -268,6 +268,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] == ':') |
