Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > by-pkgid > 32037be379e611f94dc6983bd77d22d9 > files > 7

squidGuard-1.3-1mdv2009.0.src.rpm

--- src/sgDiv.c.in	2007-11-03 14:59:49.000000000 +0100
+++ src/sgDiv.c.in.oden	2008-06-13 19:01:43.000000000 +0200
@@ -94,6 +94,7 @@ int parseLine(line, s)
   int i = 0;
   char c;
   int report_once = 1;
+  int trailingdot = 1;
   size_t strsz;
   int ndx = 0;
   
@@ -148,6 +149,16 @@ int parseLine(line, s)
             report_once--;
           }
       }
+      else if ('.' == p[ndx] && '/' == p[ndx+1] && trailingdot == 0) {
+      /* If the domain has trailing dot, remove (problem found with squid 3.0 stable1-5) */
+      /* if this char is a dot and the next char is a slash, then shift the rest of the string left one char */
+      /* We do this only the first time it is encountered. */
+         trailingdot++;
+         size_t sz = strlen(p+ndx+1);
+         strncpy(p+ndx,p+ndx+1, sz);
+         p[ndx+sz] = '\0';
+         @NOLOG1@ sgLogError("Warning: Possible bypass attempt. Found a trailing dot in the domain name: %s", s->orig); @NOLOG2@
+      }
       else
       {
         /* increment the string indexer */