]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
protect from bad file numbers in comm_close
authorwessels <>
Wed, 6 Nov 1996 15:14:33 +0000 (15:14 +0000)
committerwessels <>
Wed, 6 Nov 1996 15:14:33 +0000 (15:14 +0000)
src/disk.cc

index 3483e4533438383d78fd0c55e49314872ae4d928..a24e5874b274c2241ad31db2a86e530b36d49de1 100644 (file)
@@ -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 */