* to ensure equivalent paths share the hcache */
if (stat (folder, &st) == 0)
{
- p = safe_malloc (_POSIX_PATH_MAX+1);
+ p = safe_malloc (PATH_MAX+1);
if (!realpath (folder, p))
mutt_str_replace (&p, folder);
} else
static int
hcache_open_gdbm (struct header_cache* h, const char* path)
{
- int pagesize = atoi(HeaderCachePageSize) ? atoi(HeaderCachePageSize) : 16384;
+ int pagesize;
+
+ if (mutt_atoi (HeaderCachePageSize, &pagesize) < 0 || pagesize <= 0)
+ pagesize = 16384;
h->db = gdbm_open((char *) path, pagesize, GDBM_WRCREAT, 00600, NULL);
if (h->db)
struct stat sb;
int ret;
u_int32_t createflags = DB_CREATE;
- int pagesize = atoi (HeaderCachePageSize);
+ int pagesize;
+
+ if (mutt_atoi (HeaderCachePageSize, &pagesize) < 0 || pagesize <= 0)
+ pagesize = 16384;
snprintf (h->lockfile, _POSIX_PATH_MAX, "%s-lock-hack", path);