From 79b45a37c1576bfc07f9b4aa45ba43d0a6e4e17f Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 22 Apr 2016 16:55:59 +0200 Subject: [PATCH] Fix off-by-one read in `latlon2ul()` --- pdns/sillyrecords.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pdns/sillyrecords.cc b/pdns/sillyrecords.cc index b2a7ea1884..289cdb18cb 100644 --- a/pdns/sillyrecords.cc +++ b/pdns/sillyrecords.cc @@ -137,6 +137,9 @@ latlon2ul(const char **latlonstrptr, int *which) break; } + if (!*cp) + return 0; + cp++; /* skip the hemisphere */ while (*cp && !isspace(*cp)) /* if any trailing garbage */ -- 2.47.2