File CVE-2017-15093-3.7.4.patch of Package pdns-recursor.7531

diff -ru pdns-recursor-3.7.4.orig/ws-recursor.cc pdns-recursor-3.7.4/ws-recursor.cc
--- pdns-recursor-3.7.4.orig/ws-recursor.cc	2017-01-13 12:03:03.000000000 +0100
+++ pdns-recursor-3.7.4/ws-recursor.cc	2017-11-02 18:10:54.764426426 +0100
@@ -79,10 +79,11 @@
       throw ApiException("'value' must be an array");
     }
 
+    NetmaskGroup nmg;
     for (SizeType i = 0; i < jlist.Size(); ++i) {
       try {
-        Netmask(jlist[i].GetString());
-      } catch (NetmaskException &e) {
+        nmg.addMask(jlist[i].GetString());
+      } catch (const NetmaskException &e) {
         throw ApiException(e.reason);
       }
     }
@@ -94,9 +95,7 @@
 
     // Clear allow-from, and provide a "parent" value
     ss << "allow-from=" << endl;
-    for (SizeType i = 0; i < jlist.Size(); ++i) {
-      ss << "allow-from+=" << jlist[i].GetString() << endl;
-    }
+    ss << "allow-from+=" << nmg.toString() << endl;
 
     apiWriteConfigFile("allow-from", ss.str());
 
@@ -233,10 +232,16 @@
     string serverlist;
     if (servers.IsArray()) {
       for (SizeType i = 0; i < servers.Size(); ++i) {
-        if (!serverlist.empty()) {
-          serverlist += ";";
+        string server = servers[i].GetString();
+        try {
+          ComboAddress ca = parseIPAndPort(server, 53);
+          if (!serverlist.empty()) {
+            serverlist += ";";
+          }
+          serverlist += ca.toStringWithPort();
+        } catch (const PDNSException &e) {
+          throw ApiException(e.reason);
         }
-        serverlist += servers[i].GetString();
       }
     }
 
openSUSE Build Service is sponsored by