Fix segv bug in XML pubhublist handler.
[doldaconnect.git] / clients / gtk2 / main.c
index 88d68b9..880c641 100644 (file)
@@ -102,7 +102,7 @@ pid_t pubhubproc = 0;
 char *pubhubaddr = NULL;
 char *connectas = NULL;
 char *dcserver = NULL;
-int autoconn = 0;
+int autoconn = 1;
 int srchautoupdate = 0;
 int cursrch = -1, nextsrch = -1;
 time_t srcheta;
@@ -1518,6 +1518,11 @@ int pubhubxmlhandler(int op, char *buf, size_t *len)
        }
        break;
     case PHO_EOF:
+       if(ctxt == NULL)
+       {
+           msgbox(GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("A hub list could not be read from %s"), pubhubaddr);
+           break;
+       }
        xmlParseChunk(ctxt, NULL, 0, 1);
        if(!ctxt->wellFormed)
        {