From: Hoa Le <ho...@de...> - 2018-06-04 05:07:16
|
If ntfimcnd was restarted during a CCB, it might receive ObjectDelete operation as the first event. ccbUtilCcbData, which was initialized in this case, does not contain the operation invoker name. This causes ntfimcnd to crash and generates a coredump when the ccbUtilCcbData being used in the next ApplyCallback. This patch helps avoid the above issue by validating the operation invoker name in ApplyCallback and restarting ntfimcnd if the invoker name is invalid. An error report notification will be sent out when ntfimcnd being successfully started. --- src/ntf/ntfimcnd/ntfimcn_imm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ntf/ntfimcnd/ntfimcn_imm.c b/src/ntf/ntfimcnd/ntfimcn_imm.c index d8084b6..2229310 100644 --- a/src/ntf/ntfimcnd/ntfimcn_imm.c +++ b/src/ntf/ntfimcnd/ntfimcn_imm.c @@ -694,6 +694,20 @@ static void saImmOiCcbApplyCallback(SaImmOiHandleT immOiHandle, case CCBUTIL_DELETE: invoke_name_ptr = (SaNameT *)ccbUtilCcbData->userData; + if (invoke_name_ptr == NULL) { + /* Fix for ticket #2859. + * If ntfimcnd was restarted during a CCB, it + * might receive ObjectDelete operation as the + * first event. The ccbUtilCcbData, which was + * initialized in this case, does not contain + * the operation invoker name. + */ + LOG_ER("%s send_object_delete_notification " + "fail, missing operation " + "invoker name",__FUNCTION__); + internal_rc = (-1); + goto done; + } internal_rc = ntfimcn_send_object_delete_notification( ccbUtilOperationData, invoke_name_ptr, ccbLast); if (internal_rc != 0) { -- 2.7.4 |