Re: tst_test: Add may_kmemleak flag and annotate tests

Cyril Hrubis <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi!
> > tst_test: Add may_kmemleak flag and annotate tests
> 
> --- [PATCH 1/13] ---
> 
> > This information was so far recoded only in the comment in the cve
> 
> Typo: "recoded" should be "recorded".
> 
> --- [PATCH 8/13] ---
> 
> > lib: tst_test: Move the iterations to struct tst_test
> 
> > -		iterations = SAFE_STRTOL(optarg, 0, INT_MAX);
> > +		tst_test->iterations = SAFE_STRTOL(optarg, 0, UINT_MAX);
> 
> safe_strtol() takes `long min, long max` parameters. On 32-bit
> systems where sizeof(long) == 4, passing UINT_MAX (4294967295U) as
> a long overflows to -1, making the valid range [0, -1]. This causes
> the range check to reject all positive values, breaking the -i
> option on 32-bit.
> 
> Should this use INT_MAX (as before) or SAFE_STRTOUL?

Good catch, indeed this should be changed to SAFE_STRTOUL()

-- 
Cyril Hrubis
[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.