You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by "bryancall (via GitHub)" <gi...@apache.org> on 2023/11/15 17:36:35 UTC
[PR] Coverity 1523685: Use of 32-bit time_t [trafficserver]
bryancall opened a new pull request, #10788:
URL: https://github.com/apache/trafficserver/pull/10788
Don't cast 64bit time_t to int
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc [trafficserver]
Posted by "masaori335 (via GitHub)" <gi...@apache.org>.
masaori335 commented on code in PR #10788:
URL: https://github.com/apache/trafficserver/pull/10788#discussion_r1396528565
##########
src/proxy/hdrs/unit_tests/test_Hdrs.cc:
##########
@@ -679,13 +679,13 @@ TEST_CASE("HdrTest", "[proxy][hdrtest]")
// (2) test a few times per day from 1/1/1970 to past 2010
- for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<int>(ts::Random::drandom() * (24 * 60 * 60))) {
+ for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<time_t>(ts::Random::drandom() * (24 * 60 * 60))) {
cftime_replacement(buffer, sizeof(buffer), "%a, %d %b %Y %T %Z", &t);
t2 = mime_parse_date(buffer, buffer + static_cast<int>(strlen(buffer)));
if (t2 != t) {
std::printf("FAILED: parsed time_t doesn't match original time_t\n");
- std::printf(" input time_t: %d (%s)\n", static_cast<int>(t), buffer);
Review Comment:
This needs to be `PRIdMAX` like #10804?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc [trafficserver]
Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on code in PR #10788:
URL: https://github.com/apache/trafficserver/pull/10788#discussion_r1396535423
##########
src/proxy/hdrs/unit_tests/test_Hdrs.cc:
##########
@@ -679,13 +679,13 @@ TEST_CASE("HdrTest", "[proxy][hdrtest]")
// (2) test a few times per day from 1/1/1970 to past 2010
- for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<int>(ts::Random::drandom() * (24 * 60 * 60))) {
+ for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<time_t>(ts::Random::drandom() * (24 * 60 * 60))) {
cftime_replacement(buffer, sizeof(buffer), "%a, %d %b %Y %T %Z", &t);
t2 = mime_parse_date(buffer, buffer + static_cast<int>(strlen(buffer)));
if (t2 != t) {
std::printf("FAILED: parsed time_t doesn't match original time_t\n");
- std::printf(" input time_t: %d (%s)\n", static_cast<int>(t), buffer);
Review Comment:
Let me compile it on my m2 max. My guess is yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc [trafficserver]
Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall merged PR #10788:
URL: https://github.com/apache/trafficserver/pull/10788
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc [trafficserver]
Posted by "bryancall (via GitHub)" <gi...@apache.org>.
bryancall commented on code in PR #10788:
URL: https://github.com/apache/trafficserver/pull/10788#discussion_r1396535423
##########
src/proxy/hdrs/unit_tests/test_Hdrs.cc:
##########
@@ -679,13 +679,13 @@ TEST_CASE("HdrTest", "[proxy][hdrtest]")
// (2) test a few times per day from 1/1/1970 to past 2010
- for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<int>(ts::Random::drandom() * (24 * 60 * 60))) {
+ for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += static_cast<time_t>(ts::Random::drandom() * (24 * 60 * 60))) {
cftime_replacement(buffer, sizeof(buffer), "%a, %d %b %Y %T %Z", &t);
t2 = mime_parse_date(buffer, buffer + static_cast<int>(strlen(buffer)));
if (t2 != t) {
std::printf("FAILED: parsed time_t doesn't match original time_t\n");
- std::printf(" input time_t: %d (%s)\n", static_cast<int>(t), buffer);
Review Comment:
let me compile it on my m2 max
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@trafficserver.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org