]> granicus.if.org Git - pdns/commitdiff
fix truncated LOC parsing, closes #894
authorPeter van Dijk <peter.van.dijk@netherlabs.nl>
Wed, 3 Jul 2013 18:24:51 +0000 (20:24 +0200)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Wed, 3 Jul 2013 18:41:06 +0000 (20:41 +0200)
pdns/sillyrecords.cc

index d2b8758e133d6ee1432042cf2bb29a70b1f6be44..cb859078006352a1844fe8f3526cef3b7739fb5b 100644 (file)
@@ -76,7 +76,7 @@ latlon2ul(const char **latlonstrptr, int *which)
   while (isspace(*cp))
     cp++;
   
-  if (!(isdigit(*cp)))
+  if (*cp && !(isdigit(*cp)))
     goto fndhemi;
   
   while (isdigit(*cp))
@@ -95,7 +95,7 @@ latlon2ul(const char **latlonstrptr, int *which)
     }
   }
   
-  while (!isspace(*cp))   /* if any trailing garbage */
+  while (*cp && !isspace(*cp))   /* if any trailing garbage */
     cp++;
   
   while (isspace(*cp))
@@ -136,7 +136,7 @@ latlon2ul(const char **latlonstrptr, int *which)
 
   cp++;                   /* skip the hemisphere */
   
-  while (!isspace(*cp))   /* if any trailing garbage */
+  while (*cp && !isspace(*cp))   /* if any trailing garbage */
     cp++;
   
   while (isspace(*cp))    /* move to next field */