From: Peter van Dijk Date: Wed, 3 Jul 2013 18:24:51 +0000 (+0200) Subject: fix truncated LOC parsing, closes #894 X-Git-Tag: auth-3.3~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4eec51b6672dbb5c7cb0a07bbcbeae438d87d5b3;p=pdns fix truncated LOC parsing, closes #894 --- 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 */