Browse Source

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

wip/ssl-fprint
Oswald Buddenhagen 19 years ago
parent
commit
2e39fa9930
  1. 2
      src/drv_maildir.c
  2. 2
      src/mdconvert.c

2
src/drv_maildir.c

@ -640,7 +640,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