Browse Source

work around glibc bug: printf("%.*s", INT_MAX, s) tries to allocate 2G.

wip/maildir-uid-dupes-test
Oswald Buddenhagen 19 years ago
parent
commit
d2463a4cd8
  1. 2
      src/drv_maildir.c
  2. 2
      src/mdconvert.c

2
src/drv_maildir.c

@ -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 );

2
src/mdconvert.c

@ -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…
Cancel
Save