diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2010-04-18 18:01:38 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2010-04-18 18:06:35 +0200 |
commit | ec06293134b85876f9201d8a52b844c41581b2b3 (patch) | |
tree | 3fec8f3fea397c3c47f9ca1c73d73dd560a3bb55 /uid.c | |
parent | 414a380974f78d0bb62ca953398bf1f54b28a58d (diff) | |
download | fetchmail-ec06293134b85876f9201d8a52b844c41581b2b3.tar.gz fetchmail-ec06293134b85876f9201d8a52b844c41581b2b3.tar.bz2 fetchmail-ec06293134b85876f9201d8a52b844c41581b2b3.zip |
SECURITY FIX: DoS on EILSEQ in report_*() in -vv and multibyte-locales.
Diffstat (limited to 'uid.c')
-rw-r--r-- | uid.c | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -20,6 +20,7 @@ #include "fetchmail.h" #include "i18n.h" +#include "sdump.h" /* * Machinery for handling UID lists live here. This is mainly to support @@ -260,8 +261,11 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile) if (uidlcount) { report_build(stdout, GT_("Scratch list of UIDs:")); - for (idp = scratchlist; idp; idp = idp->next) - report_build(stdout, " %s", idp->id); + for (idp = scratchlist; idp; idp = idp->next) { + char *t = sdump(idp->id, strlen(idp->id)); + report_build(stdout, " %s", t); + free(t); + } if (!idp) report_build(stdout, GT_(" <empty>")); report_complete(stdout, "\n"); @@ -517,8 +521,11 @@ void uid_swap_lists(struct query *ctl) report_build(stdout, GT_("Merged UID list from %s:"), ctl->server.pollname); else report_build(stdout, GT_("New UID list from %s:"), ctl->server.pollname); - for (idp = dofastuidl ? ctl->oldsaved : ctl->newsaved; idp; idp = idp->next) - report_build(stdout, " %s = %d", idp->id, idp->val.status.mark); + for (idp = dofastuidl ? ctl->oldsaved : ctl->newsaved; idp; idp = idp->next) { + char *t = sdump(idp->id, strlen(idp->id)); + report_build(stdout, " %s = %d", t, idp->val.status.mark); + free(t); + } if (!idp) report_build(stdout, GT_(" <empty>")); report_complete(stdout, "\n"); @@ -567,8 +574,11 @@ void uid_discard_new_list(struct query *ctl) /* this is now a merged list! the mails which were seen in this * poll are marked here. */ report_build(stdout, GT_("Merged UID list from %s:"), ctl->server.pollname); - for (idp = ctl->oldsaved; idp; idp = idp->next) - report_build(stdout, " %s = %d", idp->id, idp->val.status.mark); + for (idp = ctl->oldsaved; idp; idp = idp->next) { + char *t = sdump(idp->id, strlen(idp->id)); + report_build(stdout, " %s = %d", t, idp->val.status.mark); + free(t); + } if (!idp) report_build(stdout, GT_(" <empty>")); report_complete(stdout, "\n"); |