htextauth: Fixed segfault.
authorFredrik Tolf <fredrik@dolda2000.com>
Thu, 7 Oct 2010 07:48:28 +0000 (09:48 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Thu, 7 Oct 2010 07:48:28 +0000 (09:48 +0200)
src/htextauth.c

index 27217e0..f20c776 100644 (file)
@@ -147,11 +147,11 @@ static void serve(struct hthead *req, int fd)
     size_t declen;
     
     now = time(NULL);
+    dec = NULL;
     if(reqssl && (((raw = getheader(req, "X-Ash-Protocol")) == NULL) || strcmp(raw, "https"))) {
        simpleerror(fd, 403, "Forbidden", "The requested resource must be requested over HTTPS.");
        goto out;
     }
-    dec = NULL;
     if(((raw = getheader(req, "Authorization")) == NULL) || strncasecmp(raw, "basic ", 6)) {
        reqauth(req, fd);
        goto out;