The Debian package patches the calendar source files to support Unicode in the form of wide characters (wchar_t) in place of traditional chars. In a few places, the patches don't completely replace the old char-like behavior, or too aggressively try to use wchar-like behavior on old- style char strings.
The attached patch (to the Debian quilt patches) fixes the buffer overflow, which was caused by using 'sizeof' (which returns a count of bytes) to calculate the maximum size passed to 'swprintf' (which expects the size as a count of wide characters). The patch also fixes some related warnings from the compile, also caused by incorrect handling of wchars: io.c: In function ‘cal’: io.c:133:6: warning: format ‘%ls’ expects type ‘wchar_t *’, but argument 3 has type ‘char *’ io.c:216:10: warning: passing argument 1 of ‘swprintf’ from incompatible pointer type /usr/include/bits/wchar2.h:286:1: note: expected ‘wchar_t * __restrict__’ but argument is of type ‘wchar_t (*)[31]’ io.c:227:12: warning: passing argument 1 of ‘swprintf’ from incompatible pointer type /usr/include/bits/wchar2.h:286:1: note: expected ‘wchar_t * __restrict__’ but argument is of type ‘wchar_t **’ I'll send these patches upstream to Debian. ** Patch added: "Fix wide character handling in Debian quilt patches" https://bugs.launchpad.net/ubuntu/+source/bsdmainutils/+bug/697213/+attachment/1803322/+files/calendar_wchar_handling.diff -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/697213 Title: calendar crash on natty : buffer overflow detected -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs