diff --git a/libsepol/src/services.c b/libsepol/src/services.c index 7becfd1b35..2972372967 100644 --- a/libsepol/src/services.c +++ b/libsepol/src/services.c @@ -797,7 +797,7 @@ static int constraint_expr_eval_reason(context_struct_t *scontext, for (x = 0; buffers[x] != NULL; x++) { while (1) { - p = *r_buf + reason_buf_used; + p = *r_buf ? (*r_buf + reason_buf_used) : NULL; len = snprintf(p, reason_buf_len - reason_buf_used, "%s", buffers[x]); if (len < 0 || len >= reason_buf_len - reason_buf_used) {