On 2013-03-08 22:25:46, Antoine Beaupré wrote:
> I really wonder what to do at this point. I can certainly upload the 2.0
> version to experimental to allow people to test this more thoroughly
> (but then again, it's just once C file, easy enough to test). But I
> don't feel those bugs are serious enough to block the Wheezy release. It
> doesn't seem those issues are critical enough to justify the "serious"
> severity, but maybe I am wrong.
>
> Would I would like to do is to upload a 1.1-2 with Bremner's patch and
> then request an unblock and close this bug report.

Even with David's patch and ttyclock and sig initialized (see the
attached patch), there are some issues left: the incorrect type of
ttyclock->running and calling ncurses stuff in the signal handler.

Anyway, signals intermixed with ncurses is very much out of my comfort
zone. Maybe Thorsten (CCed) can provide additional input on those issues.

Regards
-- 
Sebastian Ramacher
diff --git a/ttyclock.c b/ttyclock.c
index 6df69e6..15e8151 100644
--- a/ttyclock.c
+++ b/ttyclock.c
@@ -58,6 +58,7 @@ init(void)
      refresh();
 
      /* Init signal handler */
+     sigemptyset(&sig.sa_mask);
      sig.sa_handler = signal_handler;
      sig.sa_flags   = 0;
      sigaction(SIGWINCH, &sig, NULL);
@@ -445,6 +446,7 @@ main(int argc, char **argv)
 
      /* Alloc ttyclock */
      ttyclock = malloc(sizeof(ttyclock_t));
+     memset(ttyclock, 0, sizeof(ttyclock_t));
 
      /* Date format */
      ttyclock->option.format = malloc(sizeof(char) * 100);
@@ -478,14 +480,14 @@ main(int argc, char **argv)
                break;
           case 'i':
                puts("TTY-Clock 2 © by Martin Duquesnoy (xor...@gmail.com)");
-               free(ttyclock);
                free(ttyclock->option.format);
+               free(ttyclock);
                exit(EXIT_SUCCESS);
                break;
           case 'v':
                puts("TTY-Clock 2 © devel version");
-               free(ttyclock);
                free(ttyclock->option.format);
+               free(ttyclock);
                exit(EXIT_SUCCESS);
                break;
           case 's':
@@ -527,8 +529,8 @@ main(int argc, char **argv)
           key_event();
      }
 
-     free(ttyclock);
      free(ttyclock->option.format);
+     free(ttyclock);
      endwin();
 
      return 0;

Attachment: signature.asc
Description: Digital signature

Reply via email to