summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/libsm/memstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.sbin/sendmail/libsm/memstat.c')
-rw-r--r--gnu/usr.sbin/sendmail/libsm/memstat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.sbin/sendmail/libsm/memstat.c b/gnu/usr.sbin/sendmail/libsm/memstat.c
index 66cddadd0bc..e720ca77b2e 100644
--- a/gnu/usr.sbin/sendmail/libsm/memstat.c
+++ b/gnu/usr.sbin/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
@@ -8,7 +8,7 @@
*/
#include <sm/gen.h>
-SM_RCSID("@(#)$Sendmail: memstat.c,v 1.5 2006/06/28 23:57:59 ca Exp $")
+SM_RCSID("@(#)$Sendmail: memstat.c,v 1.6 2007/03/20 23:26:12 ca Exp $")
#include <errno.h>
#include <sm/misc.h>
@@ -266,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] == ':')