Nack, not a solution. See Praveen's patch.
/HansF

> -----Original Message-----
> From: Hans Nordebäck
> Sent: den 27 juni 2014 15:31
> To: Hans Feldt; [email protected]; [email protected]
> Cc: [email protected]
> Subject: [PATCH 1 of 1] AMF: Avoid segmentation violation in *_ccb_apply_cb 
> [#947]
> 
>  osaf/services/saf/amf/amfd/cstype.cc      |  2 ++
>  osaf/services/saf/amf/amfd/sg.cc          |  3 +++
>  osaf/services/saf/amf/amfd/sgtype.cc      |  3 +++
>  osaf/services/saf/amf/amfd/si.cc          |  3 +++
>  osaf/services/saf/amf/amfd/sutcomptype.cc |  5 ++++-
>  osaf/services/saf/amf/amfd/sutype.cc      |  3 +++
>  osaf/services/saf/amf/amfd/svctype.cc     |  3 +++
>  7 files changed, 21 insertions(+), 1 deletions(-)
> 
> 
> diff --git a/osaf/services/saf/amf/amfd/cstype.cc 
> b/osaf/services/saf/amf/amfd/cstype.cc
> --- a/osaf/services/saf/amf/amfd/cstype.cc
> +++ b/osaf/services/saf/amf/amfd/cstype.cc
> @@ -213,6 +213,8 @@ static SaAisErrorT cstype_ccb_completed_
>               break;
>       case CCBUTIL_DELETE:
>               cst = cstype_db->find(Amf::to_string(&opdata->objectName));
> +             if (cst == 0)
> +                     goto done;
>               if (cst->list_of_csi != NULL) {
>                       /* check whether there exists a delete operation for
>                        * each of the CSI in the cs_type list in the current 
> CCB
> diff --git a/osaf/services/saf/amf/amfd/sg.cc 
> b/osaf/services/saf/amf/amfd/sg.cc
> --- a/osaf/services/saf/amf/amfd/sg.cc
> +++ b/osaf/services/saf/amf/amfd/sg.cc
> @@ -1406,6 +1406,9 @@ static SaAisErrorT sg_ccb_completed_cb(C
>               break;
>       case CCBUTIL_DELETE:
>               sg = sg_db->find(Amf::to_string(&opdata->objectName));
> +             if (sg == 0)
> +                     goto done;
> +
>               if (sg->list_of_si != NULL) {
>                       /* check whether there is parent app delete */
>                       t_opData = ccbutil_getCcbOpDataByDN(opdata->ccbId, 
> &sg->app->name);
> diff --git a/osaf/services/saf/amf/amfd/sgtype.cc 
> b/osaf/services/saf/amf/amfd/sgtype.cc
> --- a/osaf/services/saf/amf/amfd/sgtype.cc
> +++ b/osaf/services/saf/amf/amfd/sgtype.cc
> @@ -370,6 +370,9 @@ static SaAisErrorT sgtype_ccb_completed_
>               break;
>       case CCBUTIL_DELETE:
>               sgt = sgtype_db->find(Amf::to_string(&opdata->objectName));
> +             if (sgt == 0)
> +                     goto done;
> +
>               if (sgt->list_of_sg != NULL) {
>                       /* check whether there exists a delete operation for
>                        * each of the SG in the sg_type list in the current CCB
> diff --git a/osaf/services/saf/amf/amfd/si.cc 
> b/osaf/services/saf/amf/amfd/si.cc
> --- a/osaf/services/saf/amf/amfd/si.cc
> +++ b/osaf/services/saf/amf/amfd/si.cc
> @@ -953,6 +953,9 @@ static SaAisErrorT si_ccb_completed_cb(C
>               break;
>       case CCBUTIL_DELETE:
>               si = avd_si_get(&opdata->objectName);
> +             if (si == 0)
> +                     goto done;
> +
>               if (NULL != si->list_of_sisu) {
>                       report_ccb_validation_error(opdata, "SaAmfSI is in use 
> '%s'", si->name.value);
>                       goto done;
> diff --git a/osaf/services/saf/amf/amfd/sutcomptype.cc 
> b/osaf/services/saf/amf/amfd/sutcomptype.cc
> --- a/osaf/services/saf/amf/amfd/sutcomptype.cc
> +++ b/osaf/services/saf/amf/amfd/sutcomptype.cc
> @@ -128,6 +128,9 @@ static SaAisErrorT sutcomptype_ccb_compl
>               break;
>       case CCBUTIL_DELETE:
>               sutcomptype = 
> sutcomptype_db->find(Amf::to_string(&opdata->objectName));
> +             if (sutcomptype == 0)
> +                     goto done;
> +
>               if (sutcomptype->curr_num_components == 0) {
>                       rc = SA_AIS_OK;
>                       opdata->userData = sutcomptype; /* Save for later use 
> in apply */
> @@ -137,7 +140,7 @@ static SaAisErrorT sutcomptype_ccb_compl
>               osafassert(0);
>               break;
>       }
> -
> +done:
>       return rc;
>  }
> 
> diff --git a/osaf/services/saf/amf/amfd/sutype.cc 
> b/osaf/services/saf/amf/amfd/sutype.cc
> --- a/osaf/services/saf/amf/amfd/sutype.cc
> +++ b/osaf/services/saf/amf/amfd/sutype.cc
> @@ -356,6 +356,9 @@ static SaAisErrorT sutype_ccb_completed_
>               break;
>       case CCBUTIL_DELETE:
>               sut = sutype_db->find(Amf::to_string(&opdata->objectName));
> +             if (sut == 0)
> +                     goto done;
> +
>               if (NULL != sut->list_of_su) {
>                       /* check whether there exists a delete operation for
>                        * each of the SU in the su_type list in the current CCB
> diff --git a/osaf/services/saf/amf/amfd/svctype.cc 
> b/osaf/services/saf/amf/amfd/svctype.cc
> --- a/osaf/services/saf/amf/amfd/svctype.cc
> +++ b/osaf/services/saf/amf/amfd/svctype.cc
> @@ -149,6 +149,9 @@ static SaAisErrorT svctype_ccb_completed
>               break;
>       case CCBUTIL_DELETE:
>               svc_type = 
> svctype_db->find(Amf::to_string(&opdata->objectName));
> +             if (svc_type == 0)
> +                     goto done;
> +
>               if (NULL != svc_type->list_of_si) {
>                       /* check whether there exists a delete operation for
>                        * each of the SI in the svc_type list in the current 
> CCB

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to