diff options
author | Omar Polo <op@omarpolo.com> | 2021-10-15 07:51:15 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-10-15 07:51:15 +0000 |
commit | 387b976b99496c76d54831c44fb4c218e896c359 (patch) | |
tree | 24ffed44431883fe875f9f9b105ed3abb0cf4d2d /log.c | |
parent | 80444938654389aa7970aaa43c4590d63da6844d (diff) |
c->req may be NULL now
Diffstat (limited to 'log.c')
-rw-r--r-- | log.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -213,7 +213,8 @@ void log_request(struct client *c, char *meta, size_t l) { char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV], b[GEMINI_URL_LEN]; - char *t, *fmted; + char *fmted; + const char *t; size_t len; int ec; @@ -244,7 +245,9 @@ log_request(struct client *c, char *meta, size_t l) strlcat(b, c->iri.query, sizeof(b)); } } else { - strlcpy(b, c->req, sizeof(b)); + if ((t = c->req) == NULL) + t = ""; + strlcpy(b, t, sizeof(b)); } if ((t = gmid_strnchr(meta, '\r', l)) == NULL) |