openhpi2 / Open-HPI

Open HPI is an open source implementation of the SA Forum's Hardware Platform Interface (HPI). HPI provides an abstracted interface to managing computer hardware, typically for chassis and rack based servers
Other
3 stars 1 forks source link

Make oh_get_global_param() in openhpid/conf.c more robust #2491

Closed openhpi2 closed 8 years ago

openhpi2 commented 11 years ago

Make oh_get_global_param() more robust

If oh_get_global_param() gets called with param null we will segfault because we are not exiting the function and dereferencing it via param->type.

diff --git a/openhpi/trunk/openhpid/conf.c b/openhpi/trunk/openhpid/conf.c index 10f2f62..ac0de69 100644 --- a/openhpi/trunk/openhpid/conf.c +++ b/openhpi/trunk/openhpid/conf.c @@ -689,13 +689,13 @@ int oh_get_global_param(struct oh_global_param *param)

if (!param) { CRIT("Invalid parameters param NULL.");

if (!param->type) { CRIT("Invalid parameters param->type NULL.");

read_globals_from_env(0);

Reported by: mbaldessari

openhpi2 commented 11 years ago

Original comment by: dr_mohan

openhpi2 commented 11 years ago

Fixed in #7532

Original comment by: dr_mohan

openhpi2 commented 11 years ago

Original comment by: dr_mohan

openhpi2 commented 11 years ago

*_ATTENTION_** This account is disabled and is no longer accessed by the recipient. Please remove it from your address book.

Thanks

Original comment by: tariqx