]> git.sur5r.net Git - bacula/bacula/commitdiff
Add debug info to smartall.c for buffer overrun
authorKern Sibbald <kern@sibbald.com>
Mon, 19 Jul 2010 11:39:29 +0000 (13:39 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 12 Nov 2010 08:20:43 +0000 (09:20 +0100)
bacula/src/lib/smartall.c

index f3f899b5356fe99bdd9a713a6828ae2c5ee0f224..db2066d0e57a883a3e7fb4d3d1634a1e7f34f4ca 100644 (file)
@@ -212,6 +212,9 @@ void sm_free(const char *file, int line, void *fp)
 
    if (((unsigned char *)cp)[head->ablen - 1] != ((((intptr_t) cp) & 0xFF) ^ 0xC5)) {
       V(mutex);
+      Dmsg4(0, "Overrun buffer: len=%d addr=%p allocated: %s:%d\n",
+         head->ablen, fp,
+         head->abfname, head->ablineno);
       Emsg2(M_ABORT, 0, _("Buffer overrun called from %s:%d\n"), file, line);
    }
    if (sm_buffers > 0) {