Hi Alex, Ack. Will push the same. Mathi.
----- [email protected] wrote: > osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c | 2 +- > osaf/services/saf/plmsv/plms/plms_adm_fsm.c | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > > > Symptoms of the problem include PLMS crashing, and the node resetting > because of > the crash. > > Valgrind shows memory corruption in the plms code. A double free, and > some > uninitialized reads. > > Solution for the double free is...don't double free! For the > uninitialized read > the malloc'd string did not take into account the NULL terminator, and > functions > later on (strchr) depend on a NULL terminator being there. > > diff --git a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c > b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c > --- a/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c > +++ b/osaf/services/saf/plmsv/plms/hpi_intf/plms_epath_util.c > @@ -411,7 +411,7 @@ SaUint32T convert_string_to_epath(SaInt8 > } > memset(epath_ptr, 0, sizeof(SaHpiEntityPathT)); > > - epath_len = strlen(epath_str); > + epath_len = strlen(epath_str) + 1; > /* allocate memory to make a duplicate of epath_str */ > if (NULL == (epath = (SaInt8T *)malloc(epath_len))) > { > diff --git a/osaf/services/saf/plmsv/plms/plms_adm_fsm.c > b/osaf/services/saf/plmsv/plms/plms_adm_fsm.c > --- a/osaf/services/saf/plmsv/plms/plms_adm_fsm.c > +++ b/osaf/services/saf/plmsv/plms/plms_adm_fsm.c > @@ -1439,6 +1439,7 @@ SaUint32T plms_HE_adm_reset_op(PLMS_EVT > plms_aff_ent_exp_rdness_status_clear(act_aff_ent_list); > plms_ent_exp_rdness_status_clear(ent); > plms_ent_grp_list_free(trk_info->group_info_list); > + trk_info->group_info_list = NULL; > }else if (is_flag_aff){ > /*Fill the expected readiness state of the root ent.*/ > plms_ent_exp_rdness_state_ow(ent); > @@ -1457,7 +1458,7 @@ SaUint32T plms_HE_adm_reset_op(PLMS_EVT > > plms_ent_exp_rdness_status_clear(ent); > plms_ent_grp_list_free(trk_info->group_info_list); > - > + trk_info->group_info_list = NULL; > } > > > /**********************************************************************/ > > @@ -1488,7 +1489,6 @@ SaUint32T plms_HE_adm_reset_op(PLMS_EVT > trk_info->root_entity = ent; > trk_info->track_count = count; > trk_info->aff_ent_list = aff_ent_list; > - trk_info->group_info_list = NULL; > } > else { > ret_err = saImmOiAdminOperationResult(cb->oi_hdl, ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
