Bug 559618. Treat negative max-age values as 0. r=jduell

This commit is contained in:
Boris Zbarsky 2010-04-26 16:27:01 -04:00
Родитель 0119433e2d
Коммит 14e71ac217
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -534,7 +534,10 @@ nsHttpResponseHead::GetMaxAgeValue(PRUint32 *result)
if (!p)
return NS_ERROR_NOT_AVAILABLE;
*result = (PRUint32) atoi(p + 8);
int maxAgeValue = atoi(p + 8);
if (maxAgeValue < 0)
maxAgeValue = 0;
*result = PRUint32(maxAgeValue);
return NS_OK;
}