From 94f6932d70f4c7d017b9cf0e26ae9a33f96ffa82 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 29 Apr 2009 11:55:58 +0000 Subject: [PATCH] Fix bug #1282 Setting job.Priority in python crashes director by checking if string addr is NULL. Not tested. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8762 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/dird/pythondir.c | 14 ++++++++------ bacula/technotes | 5 +++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index a0160435a8..8a10348510 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -290,12 +290,14 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value) PyErr_SetString(PyExc_RuntimeError, _("Job Level can be set only during JobInit")); return -1; } - for (i=0; joblevels[i].level_name; i++) { - if (strcmp(strval, joblevels[i].level_name) == 0) { - if (joblevels[i].job_type == jcr->get_JobType()) { - jcr->set_JobLevel(joblevels[i].level); - jcr->jr.JobLevel = jcr->get_JobLevel(); - return 0; + if (strval != NULL) { + for (i=0; joblevels[i].level_name; i++) { + if (strcmp(strval, joblevels[i].level_name) == 0) { + if (joblevels[i].job_type == jcr->get_JobType()) { + jcr->set_JobLevel(joblevels[i].level); + jcr->jr.JobLevel = jcr->get_JobLevel(); + return 0; + } } } } diff --git a/bacula/technotes b/bacula/technotes index 0cd58cc729..20ac7676bb 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -2,6 +2,11 @@ General: +29Apr09 +kes Fix bug #1282 Setting job.Priority in python crashes director by + checking if string addr is NULL. Not tested. +kes Fix bug #1281 allow all on restore command line to restore + pruned JobIds without prompting. 28Apr09 dirk Correct bat Select dialog. Fixes bug #1276. kes Check for job_canceled() in fd_plugin code. -- 2.39.5