Comment 3 for bug 965341

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Program received signal SIGSEGV, Segmentation fault.
0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
541 watch.c: No such file or directory.
(gdb) where
#0 0x0000000000402aa2 in main (argc=2, argv=0x7fffffffe0d8) at watch.c:541
(gdb) p argv[0]
$1 = 0x7fffffffe3e4 "/usr/bin/watch"
(gdb) p argv[1]
$2 = 0x7fffffffe3f3 "tail sample.dat"
(gdb) p argv[2]
$3 = 0x0
(gdb) p c
$4 = 8067886
(gdb) p/x c
$5 = 0x7b1b2e
(gdb)

line 541 is:

                                                }while (c != WEOF && !isprint(c) && c<128
                                                       && wcwidth(c) == 0
                                                       && c != L'\n'
                                                       && c != L'\t'
                   && (c != L'\033' || option_color != 1));

I'm suspicious that the isprint should be an iswprint but it might need a libc spec person to know whether isprint should
be safe.