Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/catman check also for overflow
details: https://anonhg.NetBSD.org/src/rev/a219a9251abe
branches: trunk
changeset: 772220:a219a9251abe
user: christos <christos%NetBSD.org@localhost>
date: Sat Dec 24 23:42:30 2011 +0000
description:
check also for overflow
diffstat:
usr.sbin/catman/catman.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (20 lines):
diff -r f49a015f1e5b -r a219a9251abe usr.sbin/catman/catman.c
--- a/usr.sbin/catman/catman.c Sat Dec 24 23:38:43 2011 +0000
+++ b/usr.sbin/catman/catman.c Sat Dec 24 23:42:30 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: catman.c,v 1.32 2011/12/24 23:38:43 christos Exp $ */
+/* $NetBSD: catman.c,v 1.33 2011/12/24 23:42:30 christos Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -564,8 +564,8 @@
int len;
len = snprintf(sysbuf, sizeof(sysbuf), buildcmd, manpage);
- if (len < 0)
- err(1, "snprintf");
+ if (len < 0 || len > sizeof(sysbuf))
+ errx(1, "snprintf");
if (*crunchcmd != '\0') {
snprintf(crunchbuf, sizeof(crunchbuf), crunchcmd, catpage);
Home |
Main Index |
Thread Index |
Old Index