mirror of https://github.com/aria2/aria2
commit
dbbd1bfbf9
|
@ -662,7 +662,7 @@ bool BitfieldMan::isUseBitSet(size_t index) const
|
||||||
void BitfieldMan::setBitfield(const unsigned char* bitfield,
|
void BitfieldMan::setBitfield(const unsigned char* bitfield,
|
||||||
size_t bitfieldLength)
|
size_t bitfieldLength)
|
||||||
{
|
{
|
||||||
if (bitfieldLength_ != bitfieldLength) {
|
if (bitfieldLength_ == 0 || bitfieldLength_ != bitfieldLength) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memcpy(bitfield_, bitfield, bitfieldLength_);
|
memcpy(bitfield_, bitfield, bitfieldLength_);
|
||||||
|
|
|
@ -300,12 +300,18 @@ std::unique_ptr<Cookie> parse(const std::string& cookieStr,
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
int64_t n = creationTime;
|
int64_t n = creationTime;
|
||||||
n += delta;
|
|
||||||
if (n < 0 || std::numeric_limits<time_t>::max() < n) {
|
if (n > std::numeric_limits<int64_t>::max() - delta) {
|
||||||
maxAge = std::numeric_limits<time_t>::max();
|
maxAge = std::numeric_limits<int64_t>::max();
|
||||||
}
|
} else {
|
||||||
else {
|
n += delta;
|
||||||
maxAge = n;
|
|
||||||
|
if (n < 0 || std::numeric_limits<time_t>::max() < n) {
|
||||||
|
maxAge = std::numeric_limits<time_t>::max();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
maxAge = n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue