Browse code

Fix for NULL pointer derefence when using custom database download.

Micah Snyder (micasnyd) authored on 2018/11/16 23:34:17
Showing 1 changed files
... ...
@@ -1065,8 +1065,10 @@ getfile (const char *srcfile, const char *destfile, const char *hostname,
1065 1065
                         can_whitelist, ims, ipaddr, sd);
1066 1066
     closesocket (sd);
1067 1067
 
1068
-    /* Update mirrors.dat */
1069
-    (void) mirman_write ("mirrors.dat", dbdir, mdat);
1068
+    if (mdat) {
1069
+        /* Update mirrors.dat */
1070
+        (void) mirman_write ("mirrors.dat", dbdir, mdat);
1071
+    }
1070 1072
 
1071 1073
     return ret;
1072 1074
 }