[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-mailutils] Infinity loop in folder.c roll_back()

From: maks
Subject: [bug-mailutils] Infinity loop in folder.c roll_back()
Date: Wed, 16 Jul 2014 14:06:33 +0300


static void
roll_back (const char *folder_name, struct pack_tab *pack_tab, size_t i)
  size_t start;
  if (i == 0)
  start = i - 1;
  mu_error (_("rolling back changes..."));
  while (--i >= 0)                           // <=====
    if (pack_rename (pack_tab + i, 1))
        mu_error (_("CRITICAL ERROR: Folder `%s' left in an inconsistent state, 
because an error\n"
                    "occurred while trying to roll back the changes.\n"
                    "Message range %s-%s has been renamed to %s-%s."),
                  mu_umaxtostr (0, pack_tab[0].orig),
                  mu_umaxtostr (1, pack_tab[start].orig),
                  mu_umaxtostr (2, pack_tab[0].new),
                  mu_umaxtostr (3, pack_tab[start].new));
        mu_error (_("You will have to fix it manually."));
        exit (1);
  mu_error (_("folder `%s' restored successfully"), folder_name);

'i' is size_t that always >=0. Maybe should be "while (--i > 0)"?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]