[Xenomai] [PATCH v2] psos: add tunables to configure region 0

Philippe Gerum rpm at xenomai.org
Wed Dec 28 16:11:27 CET 2016


On 12/12/2016 03:09 PM, Ronny Meeus wrote:
> +	case region0_size_opt:
> +		psos_region0_size = (u_long)atol(optarg);
> +		break;
> +	case region0_unitsize_opt:
> +		psos_region0_unitsize = (u_long)atol(optarg);
> +		break;

You may want to sanitize the input values.

> +	if (psos_region0_size) {
> +		u_long rsize;
> +		ret = rn_create("_RN0", xnmalloc(psos_region0_size), psos_region0_size,

If the value passed to --psos-rn0-size is larger than the memory
available from the main heap, rn_create() will crash on a NULL return
from xnmalloc().

-- 
Philippe.



More information about the Xenomai mailing list