]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix possible NULL-pointer dereference in cacheDir display
authoramosjeffries <>
Thu, 2 Aug 2007 07:20:47 +0000 (07:20 +0000)
committeramosjeffries <>
Thu, 2 Aug 2007 07:20:47 +0000 (07:20 +0000)
Picked up by Coverity checker.

src/cache_cf.cc

index ffebcbf192d86c8d94222989a599065fbe4a8d3c..271b150d428bbeea7214c5f0c576e550c45dc2cf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cache_cf.cc,v 1.513 2007/06/28 15:18:16 rousskov Exp $
+ * $Id: cache_cf.cc,v 1.514 2007/08/02 01:20:47 amosjeffries Exp $
  *
  * DEBUG: section 3     Configuration File Parsing
  * AUTHOR: Harvest Derived
@@ -1245,6 +1245,7 @@ dump_cachedir(StoreEntry * entry, const char *name, _SquidConfig::_cacheSwap swa
 
     for (i = 0; i < swap.n_configured; i++) {
         s = dynamic_cast<SwapDir *>(swap.swapDirs[i].getRaw());
+        if(!s) continue;
         storeAppendPrintf(entry, "%s %s %s", name, s->type(), s->path);
         s->dump(*entry);
         storeAppendPrintf(entry, "\n");