When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
Hi @GSilva849776 (Community Member) ,
In this code, if the expression would overflow, then it would wrap around and be a negative value, i.e. `(( labs((long)(60*atoi(argv[1])))) > LONG_MAX )` would be false.
I would recommend changing the check slightly. Say if you have something like this:
if (x+y > MAX_INT) { // some error } else { int result = x + y; }
Here, the same problem would occur.
Instead, a check like that would prevent it as no overflow would occur in the check itself anymore:
if (MAX_INT - X >= Y) { int result = x + y;} else { // some error }
Please note that you may have to propose a mitigation for this as Static Analysis might not be able to detect this automatically. For more information on how to do this, please refer to: https://docs.veracode.com/r/improve_mitigation .
Thank you,
Florian Walter