Ack (review only)

-----Original Message-----
From: "thuan.tran" <thuan.t...@dektech.com.au>
Date: Monday, 17 September 2018 at 9:39 pm
To: <lennart.l...@ericsson.com>, gary <gary....@dektech.com.au>
Cc: <opensaf-devel@lists.sourceforge.net>, "thuan.tran" 
<thuan.t...@dektech.com.au>
Subject: [PATCH 1/1] smf: improve CcbApplyCallback() to avoid NULL access 
[#2927]

    Current CcbApplyCallback() is not safe, may access NULL pointer
    cause SMFD crash and node restart.
    ---
     src/smf/smfd/SmfImmApplierHdl.cc | 3 +--
     1 file changed, 1 insertion(+), 2 deletions(-)
    
    diff --git a/src/smf/smfd/SmfImmApplierHdl.cc 
b/src/smf/smfd/SmfImmApplierHdl.cc
    index 25b52eb93..cddc27987 100644
    --- a/src/smf/smfd/SmfImmApplierHdl.cc
    +++ b/src/smf/smfd/SmfImmApplierHdl.cc
    @@ -446,14 +446,13 @@ static void CcbApplyCallback(SaImmOiHandleT 
immOiHandle, SaImmOiCcbIdT ccbId) {
        */
       TRACE("%s: Read value in attributes", __FUNCTION__);
       attrMod = opdata->param.modify.attrMods[0];
    -  attribute = attrMod->modAttr;
     
       for (int i = 1; attrMod != nullptr; i++) {
         /* Get the value */
    +    attribute = attrMod->modAttr;
         if (attribute_name_.compare(attribute.attrName) != 0) {
           // Not found
           attrMod = opdata->param.modify.attrMods[i];
    -      attribute = attrMod->modAttr;
           continue;
         }
     
    -- 
    2.18.0
    
    




_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to