Skip to content

Commit

Permalink
ua_status: check job->client pointer before dereferencing
Browse files Browse the repository at this point in the history
cherry picked from commit 93e2a93 
and solved merge conflicts
  • Loading branch information
alaaeddineelamri committed Nov 26, 2021
1 parent 1dda740 commit 1c3f285
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions core/src/dird/ua_status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,8 @@ static void DoSchedulerStatus(UaContext* ua)
* List specific schedule.
*/
if (job) {
if (job->schedule) {
if (job->schedule && job->schedule->enabled && job->enabled
&& job->client && job->client->enabled) {
if (!show_scheduled_preview(ua, job->schedule, overview,
&max_date_len, time_to_check)) {
goto start_again;
Expand All @@ -656,7 +657,8 @@ static void DoSchedulerStatus(UaContext* ua)
foreach_res (job, R_JOB) {
if (!ua->AclAccessOk(Job_ACL, job->resource_name_)) { continue; }

if (job->schedule && job->client == client) {
if (job->schedule && job->schedule->enabled && job->enabled
&& job->client && job->client == client && job->client->enabled) {
if (!show_scheduled_preview(ua, job->schedule, overview,
&max_date_len, time_to_check)) {
job = NULL;
Expand Down

0 comments on commit 1c3f285

Please sign in to comment.