Files
pytorch/caffe2/core
frdong 92770d25cd fix comparison of narrow type with wide type in loop condition (#53951)
Summary:
fix Semmle warning: Comparison of narrow type with wide type in loop condition

For example there is below piece of code:
for (int i=0; i<array.size(); ++i) {}

The problem is that array.size() return type is size_t can be larger type than int depending on the implementation so there is chance that i overflows (for very large array that array size is beyond the range of integer) and this loop will never be terminated.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/53951

Reviewed By: zou3519

Differential Revision: D27181495

Pulled By: malfet

fbshipit-source-id: 0612c5cedcdc656c193085e7fbb87dd163f20688
2021-03-22 16:40:35 -07:00
..
2020-07-17 17:19:47 -07:00
2019-02-12 21:16:34 -08:00
2021-03-02 20:14:23 -08:00
2020-10-30 10:14:17 -07:00
2020-08-24 18:29:45 -07:00
2020-12-18 10:54:50 -08:00
2018-10-04 02:09:56 -07:00
2019-08-12 16:12:30 -07:00
2019-06-21 23:06:27 -07:00
2018-03-27 13:10:18 -07:00
2019-12-02 20:17:42 -08:00
2018-12-12 12:21:10 -08:00
2018-12-12 12:21:10 -08:00
2018-03-27 13:10:18 -07:00
2020-01-17 12:13:34 -08:00
2020-03-03 10:33:21 -08:00
2020-10-30 10:14:17 -07:00