Hi Alex, Ack for the patch, review only
Regards, Ravi ----- Original Message ----- From: ajo...@rbbn.com To: mathi.np....@gmail.com, ravisekhar.ko...@oracle.com Cc: opensaf-devel@lists.sourceforge.net, ajo...@rbbn.com Sent: Tuesday, August 28, 2018 2:09:19 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi Subject: [PATCH 1/1] plmd: fix crash when saPlmReadinessTrack is called in error [#2919] plmd crashes when saPlmReadinessTrack is called with entities pointer set, but smaller than what plmd would return. In this case plmd is returning ERR_NO_SPACE, which is correct, but it is setting numberOfEntities without setting the entities pointer. This causes the edu routines to crash. It is not necessary to set numberOfEntities since we are returning an error code. --- src/plm/plmd/plms_proc.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plm/plmd/plms_proc.c b/src/plm/plmd/plms_proc.c index aa93e5942..2b4445394 100644 --- a/src/plm/plmd/plms_proc.c +++ b/src/plm/plmd/plms_proc.c @@ -879,6 +879,12 @@ void plms_process_trk_start_evt(PLMS_EVT *plm_evt) no_of_ent_recd = no_of_ent_in_grp; } + if (no_of_ent_in_grp != no_of_ent_recd) { + LOG_ER("PLMS: no of entities sent is != entities in grp"); + rc = SA_AIS_ERR_NO_SPACE; + goto send_resp; + } + plm_resp.res_evt.entities = (SaPlmReadinessTrackedEntitiesT *)malloc( sizeof(SaPlmReadinessTrackedEntitiesT)); @@ -889,12 +895,6 @@ void plms_process_trk_start_evt(PLMS_EVT *plm_evt) strerror(errno)); goto send_resp; } - if (no_of_ent_in_grp != no_of_ent_recd) { - LOG_ER("PLMS: no of entities sent is != entities in grp"); - plm_resp.res_evt.entities->numberOfEntities = no_of_ent_in_grp; - rc = SA_AIS_ERR_NO_SPACE; - goto send_resp; - } if (m_PLM_IS_SA_TRACK_CHANGES_SET(track_flags) || m_PLM_IS_SA_TRACK_CHANGES_ONLY_SET(track_flags)) { -- 2.14.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel