Change audit_rule_condition doesn't check null value if value is an integer 87/184087/1
authorSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 13 Jul 2018 10:52:03 +0000 (19:52 +0900)
committerSungbae Yoo <sungbae.yoo@samsung.com>
Fri, 13 Jul 2018 11:02:10 +0000 (20:02 +0900)
Signed-off-by: Sungbae Yoo <sungbae.yoo@samsung.com>
Change-Id: I6b0e80966e55d1697aad6933738c8bf03b31530b

lib/audit-trail/rule.cpp

index 02a9b7e5d80e642a5bffadde29f738fbf6bbe2d4..f96d6aa71c2db899ccb3b585bce113c4a3c59865 100644 (file)
@@ -93,7 +93,6 @@ int audit_rule_add_condition(audit_rule_h handle, unsigned int field,
                                                                unsigned int op, const void *value)
 {
        RET_ON_FAILURE(handle, AUDIT_TRAIL_ERROR_INVALID_PARAMETER);
-       RET_ON_FAILURE(value, AUDIT_TRAIL_ERROR_INVALID_PARAMETER);
 
        try {
                GetAuditRule(handle).setCondition(
@@ -102,6 +101,8 @@ int audit_rule_add_condition(audit_rule_h handle, unsigned int field,
        } catch (std::exception &e) {}
 
        try {
+               RET_ON_FAILURE(value, AUDIT_TRAIL_ERROR_INVALID_PARAMETER);
+
                GetAuditRule(handle).setCondition(
                                Field<std::string>{FieldType(field), Operator(op), (char *)value});
                return AUDIT_TRAIL_ERROR_NONE;