Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*.o
*.lo
*~
*.1
*.5
*.7
include/config.in
Makefile
PLATFORM
autom4te.cache/
config.log
config.status
config.status.lineno
configure.lineno
doc/siegerc
include/config.h
include/joedog/joepath.h
include/stamp-h1
libtool
utils/bombardment
utils/siege.config
utils/siege2csv.pl
12 changes: 7 additions & 5 deletions src/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ parse_cookie(char *cookiestr, PARSED_COOKIE* ck)
ck->expires = 0;
ck->expires = ~ck->expires;
if(ck->expires < 0){
ck->expires = ~(1 << ((sizeof(ck->expires) * 8) - 1));
ck->expires = ~0UL >> 1;
}
if(ck->expires < 0){
ck->expires = (ck->expires >> 1) * -1;
Expand All @@ -101,7 +101,8 @@ parse_cookie(char *cookiestr, PARSED_COOKIE* ck)
if (!*cookiestr) break;

lval = cookiestr;
while( *cookiestr && *cookiestr != '=' )
// httponly; can cause you to miss the path that follows it
while( *cookiestr && *cookiestr != '=' && *cookiestr != ';')
cookiestr++;

if(!strcasecmp (lval, "secure")){
Expand All @@ -110,7 +111,8 @@ parse_cookie(char *cookiestr, PARSED_COOKIE* ck)
} else {
if (!*cookiestr) return;

*cookiestr++ = 0;
if(*cookiestr != ';') // httponly; can cause you to miss the path that follows it
*cookiestr++ = 0;

rval = cookiestr;
while(*cookiestr && *cookiestr != ';')
Expand Down Expand Up @@ -183,9 +185,9 @@ add_cookie(pthread_t id, char *host, char *cookiestr)
else
fresh->domain = xstrdup(ck.domain);
fresh->next = cur;
if(cur==cookie->first)
if(cur==cookie->first) {
cookie->first = fresh;
else
} else
pre->next = fresh;
}
if(name != NULL) xfree(name);
Expand Down