We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a75f127 commit 06a1b82Copy full SHA for 06a1b82
lib/cookie.c
@@ -245,18 +245,17 @@ static bool pathmatch(const char *cookie_path, const char *request_uri)
245
*/
246
static const char *get_top_domain(const char * const domain, size_t *outlen)
247
{
248
- size_t len;
+ size_t len = 0;
249
const char *first = NULL, *last;
250
251
- if(!domain)
252
- return NULL;
253
-
254
- len = strlen(domain);
255
- last = memrchr(domain, '.', len);
256
- if(last) {
257
- first = memrchr(domain, '.', (last - domain));
258
- if(first)
259
- len -= (++first - domain);
+ if(domain) {
+ len = strlen(domain);
+ last = memrchr(domain, '.', len);
+ if(last) {
+ first = memrchr(domain, '.', (last - domain));
+ if(first)
+ len -= (++first - domain);
+ }
260
}
261
262
if(outlen)
0 commit comments