This commit is contained in:
Omar Polo 2021-10-18 10:05:55 +00:00
parent f8bcc13822
commit 4842c72d9f
6 changed files with 13 additions and 13 deletions

4
fcgi.c
View File

@ -135,7 +135,7 @@ prepare_header(struct fcgi_header *h, int type, size_t size,
memset(h, 0, sizeof(*h));
h->version = FCGI_VERSION_1;
h->type = type;
h->type = type;
h->req_id1 = (id >> 8);
h->req_id0 = (id & 0xFF);
h->content_len1 = (size >> 8);
@ -168,7 +168,7 @@ fcgi_send_param(struct bufferevent *bev, const char *name,
const char *value)
{
struct fcgi_header h;
uint32_t namlen, vallen, padlen;
uint32_t namlen, vallen, padlen;
uint8_t s[8];
size_t size;
char padding[8] = { 0 };

4
iri.c
View File

@ -229,7 +229,7 @@ path_elide_dotdot(char *path, char *i, int incr)
if (i == path)
return 0;
for (j = i-2; j != path && *j != '/'; j--)
/* noop */ ;
/* noop */ ;
if (*j == '/')
j++;
i += incr;
@ -428,7 +428,7 @@ serialize_iri(struct iri *i, char *buf, size_t len)
strlcpy(buf, i->schema, len);
strlcat(buf, "://", len);
strlcat(buf, i->host, len);
strlcat(buf, i->host, len);
strlcat(buf, "/", len);
if (i->path != NULL)

View File

@ -29,7 +29,7 @@ sandbox_server_process(void)
void
sandbox_executor_process(void)
{
log_notice(NULL, "Sandbox disabled! "
log_notice(NULL, "Sandbox disabled! "
"Please report issues upstream instead of disabling the sandbox.");
}
@ -322,7 +322,7 @@ static struct sock_filter filter[] = {
#endif
#ifdef __NR_ioctl
/* allow ioctl on fd 1, glibc doing stuff? */
SC_ALLOW_ARG(__NR_ioctl, 0, 1),
SC_ALLOW_ARG(__NR_ioctl, 0, 1),
/* allow FIONREAD needed by libevent */
SC_ALLOW_ARG(__NR_ioctl, 1, FIONREAD),
#endif
@ -645,7 +645,7 @@ sandbox_executor_process(void)
}
for (i = 0; i < FCGI_MAX; i++) {
f = &fcgi[i];
f = &fcgi[i];
if (f->path != NULL) {
if (unveil(f->path, "rw") == -1)
fatal("unveil %s", f->path);

View File

@ -540,7 +540,7 @@ static void
fmt_sbuf(const char *fmt, struct client *c, const char *path)
{
size_t i;
char buf[32];
char buf[32];
memset(buf, 0, sizeof(buf));
for (i = 0; *fmt; ++fmt) {
@ -794,7 +794,7 @@ open_dir(struct client *c)
c->diroff = 0;
c->off = 0;
start_reply(c, SUCCESS, "text/gemini");
start_reply(c, SUCCESS, "text/gemini");
evbuffer_add_printf(EVBUFFER_OUTPUT(c->bev),
"# Index of %s\n\n", c->iri.path);
return;
@ -1093,7 +1093,7 @@ start_reply(struct client *c, int code, const char *meta)
c->type != REQUEST_FCGI &&
!strcmp(meta, "text/gemini") &&
(lang = vhost_lang(c->host, c->iri.path)) != NULL) {
rr = evbuffer_add_printf(evb, ";lang=%s", lang);
rr = evbuffer_add_printf(evb, ";lang=%s", lang);
if (rr == -1)
goto err;
if (r + rr > 1027)

2
utf8.c
View File

@ -65,7 +65,7 @@ valid_multibyte_utf8(struct parser *p)
{
uint32_t cp = 0, state = 0;
for (; *p->iri; p->iri++)
for (; *p->iri; p->iri++)
if (!utf8_decode(&state, &cp, *p->iri))
break;

View File

@ -122,7 +122,7 @@ gen_certificate(const char *hostname, const char *certpath, const char *keypath)
host);
if ((pkey = EVP_PKEY_new()) == NULL)
fatal("couldn't create a new private key");
fatal("couldn't create a new private key");
if ((rsa = RSA_new()) == NULL)
fatal("couldn't generate rsa");
@ -154,7 +154,7 @@ gen_certificate(const char *hostname, const char *certpath, const char *keypath)
X509_set_issuer_name(x509, name);
if (!X509_sign(x509, pkey, EVP_sha256()))
fatal("couldn't sign the certificate");
fatal("couldn't sign the certificate");
if ((f = fopen(keypath, "w")) == NULL)
fatal("fopen(%s): %s", keypath, strerror(errno));