From 4eec51b6672dbb5c7cb0a07bbcbeae438d87d5b3 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 3 Jul 2013 20:24:51 +0200 Subject: [PATCH] fix truncated LOC parsing, closes #894 --- pdns/sillyrecords.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdns/sillyrecords.cc b/pdns/sillyrecords.cc index d2b8758e1..cb8590780 100644 --- a/pdns/sillyrecords.cc +++ b/pdns/sillyrecords.cc @@ -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 */ -- 2.50.0