From: wessels <> Date: Wed, 6 Nov 1996 15:14:33 +0000 (+0000) Subject: protect from bad file numbers in comm_close X-Git-Tag: SQUID_3_0_PRE1~5522 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb247d787f28b0b50a14af29344283711ee6bd5a;p=thirdparty%2Fsquid.git protect from bad file numbers in comm_close --- diff --git a/src/disk.cc b/src/disk.cc index 3483e45334..a24e5874b2 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,5 +1,5 @@ /* - * $Id: disk.cc,v 1.37 1996/11/04 18:12:24 wessels Exp $ + * $Id: disk.cc,v 1.38 1996/11/06 08:14:33 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -198,6 +198,10 @@ int file_close(int fd) { FD_ENTRY *conn = NULL; + if (fd < 0) { + debug_trap("file_close: bad file number"); + return DISK_ERROR; + } /* we might have to flush all the write back queue before we can * close it */