work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.
This commit is contained in:
parent
9b7c09e4b6
commit
d2463a4cd8
|
@ -662,7 +662,7 @@ maildir_scan( maildir_store_t *ctx, msglist_t *msglist )
|
|||
if (u)
|
||||
ml = u - entry->base;
|
||||
else
|
||||
ru = "", ml = INT_MAX;
|
||||
ru = "", ml = sizeof(buf);
|
||||
fnl = nfsnprintf( buf + bl, sizeof(buf) - bl, "%s/%.*s,U=%d%s", subdirs[entry->recent], ml, entry->base, uid, ru ) + 1 - 4;
|
||||
memcpy( nbuf, buf, bl + 4 );
|
||||
nfsnprintf( nbuf + bl + 4, sizeof(nbuf) - bl - 4, "%s", entry->base );
|
||||
|
|
|
@ -154,7 +154,7 @@ convert( const char *box, int altmap )
|
|||
if (u)
|
||||
ml = u - e->d_name;
|
||||
else
|
||||
ru = "", ml = INT_MAX;
|
||||
ru = "", ml = sizeof(buf);
|
||||
if (altmap) {
|
||||
if (!p)
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue
Block a user