From: Kern Sibbald Date: Mon, 4 Jun 2007 07:00:02 +0000 (+0000) Subject: Fix a seg fault in the PostgreSQL driver dereferencing a NULL pointer. X-Git-Tag: Release-7.0.0~6172 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=567a277d6e371436c378faddd41bee0ae811c694;p=bacula%2Fbacula Fix a seg fault in the PostgreSQL driver dereferencing a NULL pointer. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4973 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 6c4a40cc5b..c19fab5d84 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -453,7 +453,7 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS Mmsg(mdb->cmd, "SELECT Name from Storage WHERE StorageId=%s", edit_int64(SId[i], ed1)); if (QUERY_DB(jcr, mdb, mdb->cmd)) { - if ((row = sql_fetch_row(mdb)) != NULL) { + if ((row = sql_fetch_row(mdb)) && row[0]) { bstrncpy(Vols[i].Storage, row[0], MAX_NAME_LENGTH); } } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index b54892dbc7..ca29a66065 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,8 @@ Technical notes on version 2.1 General: +04Jun07 +kes Fix a seg fault in the PostgreSQL driver dereferencing a NULL pointer. 03Jun07 kes Implement SQLITE3_INIT_QUERY in version.h that can do an initial query for SQLite3. Use it to set PRAGMA synchronous = OFF. This