summaryrefslogtreecommitdiff
path: root/sbin/ncheck_ffs
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-12 06:39:30 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-12 06:39:30 +0000
commita841586d3488cbfc41d7a37d5d49c32394c06d99 (patch)
treeb6ad45b32c204c2eb931bafbf0ab17b14504805c /sbin/ncheck_ffs
parenteaa8c0cfe6ae68b803eecffb8d29f8784371e93f (diff)
handle snprintf potential -1 case
Diffstat (limited to 'sbin/ncheck_ffs')
-rw-r--r--sbin/ncheck_ffs/ncheck_ffs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/ncheck_ffs/ncheck_ffs.c b/sbin/ncheck_ffs/ncheck_ffs.c
index 9bf00c74d6e..28d8a1b0e39 100644
--- a/sbin/ncheck_ffs/ncheck_ffs.c
+++ b/sbin/ncheck_ffs/ncheck_ffs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ncheck_ffs.c,v 1.23 2004/08/08 19:04:25 deraadt Exp $ */
+/* $OpenBSD: ncheck_ffs.c,v 1.24 2005/04/12 06:39:29 deraadt Exp $ */
/*-
* Copyright (c) 1995, 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
@@ -26,7 +26,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.23 2004/08/08 19:04:25 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: ncheck_ffs.c,v 1.24 2005/04/12 06:39:29 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -545,14 +545,14 @@ format_entry(const char *path, struct direct *dp)
case 'I':
len = snprintf(dst, size - (dst - buf), "%u",
dp->d_ino);
- if (len >= size - (dst - buf))
+ if (len == -1 || len >= size - (dst - buf))
goto expand_buf;
dst += len;
break;
case 'P':
len = snprintf(dst, size - (dst - buf), "%s/%s",
path, dp->d_name);
- if (len >= size - (dst - buf))
+ if (len == -1 || len >= size - (dst - buf))
goto expand_buf;
dst += len;
break;