From: Kern Sibbald Date: Mon, 2 Nov 2009 19:29:25 +0000 (+0100) Subject: Fix buffer clobber when editing SQL error X-Git-Tag: Release-7.0.0~2597^2~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2d1ca6dc77caf323aad6362d22fec38eeac553be;p=bacula%2Fbacula Fix buffer clobber when editing SQL error --- diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 49e9762010..5872fa3087 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -761,9 +761,11 @@ bool db_open_batch_connexion(JCR *jcr, B_DB *mdb) } if (!db_open_database(jcr, jcr->db_batch)) { - Mmsg2(&jcr->db_batch->errmsg, _("Could not open database \"%s\": ERR=%s\n"), + POOLMEM *errmsg = get_pool_memory(PM_MESSAGE); + Mmsg2(&errmsg, _("Could not open database \"%s\": ERR=%s\n"), jcr->db_batch->db_name, db_strerror(jcr->db_batch)); - Jmsg1(jcr, M_FATAL, 0, "%s", jcr->db_batch->errmsg); + Jmsg1(jcr, M_FATAL, 0, "%s", errmsg); + free_pool_memory(errmsg); return false; } Dmsg3(100, "initdb ref=%d connected=%d db=%p\n", jcr->db_batch->ref_count,