When the hcache open fails, it was trying to dprint. The dprint had a
%s where it was passing errno, leading to a crash in strlen.
Unify the dprint messages for tcdbopen and tcdbclose to report the
path, strerror, and errno.
Thanks to Will Yardley for capturing the stack trace!
return 0;
else
{
- dprint(2, (debugfile, "tcbdbopen %s failed: %s\n", path, errno));
+ dprint(2, (debugfile, "tcbdbopen failed for %s: %s (errno %d)\n", path, strerror (errno), errno));
tcbdbdel(h->db);
return -1;
}
return;
if (!tcbdbclose(h->db))
- dprint (2, (debugfile, "tcbdbclose failed for %s: %d\n", h->folder, errno));
+ dprint (2, (debugfile, "tcbdbclose failed for %s: %s (errno %d)\n", h->folder, strerror (errno), errno));
tcbdbdel(h->db);
FREE(&h->folder);
FREE(&h);