=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/gzsig/Attic/key.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/gzsig/Attic/key.c 2005/05/29 02:41:42 1.3 +++ src/usr.bin/gzsig/Attic/key.c 2006/04/01 19:57:32 1.4 @@ -1,4 +1,4 @@ -/* $OpenBSD: key.c,v 1.3 2005/05/29 02:41:42 marius Exp $ */ +/* $OpenBSD: key.c,v 1.4 2006/04/01 19:57:32 otto Exp $ */ /* * key.c @@ -33,6 +33,7 @@ * $Vendor: key.c,v 1.2 2005/04/01 16:47:31 dugsong Exp $ */ +#include #include #include #include @@ -78,7 +79,7 @@ if (fstat(fd, &st) < 0) return (-1); - if (st.st_size == 0) { + if (st.st_size == 0 || st.st_size >= SIZE_MAX) { errno = EINVAL; return (-1); }