summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/libsm/memstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/sendmail/libsm/memstat.c')
-rw-r--r--contrib/sendmail/libsm/memstat.c7
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] == ':')
OpenPOWER on IntegriCloud