[LTP] [RFC PATCH 1/2] lib: add support for kinds of hpsize reservation

Cyril Hrubis chrubis@suse.cz
Thu Sep 7 16:10:35 CEST 2023


Hi!
> > This pointer (hugepage_path) is on stack and is passed to a function
> > that stores the structure into a list and then uses it to restore the
> > value at the end of the testrun, which will probably crash the test
> > since there will be random leftovers on the stack.
> >
> 
> 
> But the function tst_sys_conf_save_str allocates a new memory
> area for saving the structure info, the original is not used for
> appending to the list, isn't it?
> 
> strncpy() inside that function helps avoid the problem you pointed.

My bad, I was for some reason under impression that it just stores the
pointer.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list