[grisbi-devel] [PATCH] fix truncated month name for certain locales

Yuriy M. Kaminskiy yumkam at gmail.com
Thu Sep 8 23:57:15 CEST 2016


As can be noticed in the header of "Last/Current month incoming and 
outgoing" report, in some locales, there are month names that larger 
than provided buffer size (e.g. for LANG=ru_RU.UTF-8", "Сентябрь" 
[Russian for September] is 17 bytes [in UTF-8 encoding, with terminating 
\0]) and got truncated (to "Сентяб").

Also, in case of truncation, strftime/g_date_strftime return value is 
not properly handled (when supplied buffer size is insufficient and 0 is 
returned, buffer content is undefined; it may be even not \0-terminated 
and result in stack buffer overflow and DoS or host memory exposure 
[however, I doubt very much there are anything practically exploitable 
here]).

Patches attached.

P.S. I'm not subscribed, please Cc me on reply.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2001-strftime-enlarge-buffer-size.patch
Type: text/x-patch
Size: 3571 bytes
Desc: not available
URL: <http://listes.grisbi.org/pipermail/devel/attachments/20160909/22e04f11/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2002-Check-strftime-return-code.patch
Type: text/x-patch
Size: 4986 bytes
Desc: not available
URL: <http://listes.grisbi.org/pipermail/devel/attachments/20160909/22e04f11/attachment-0001.bin>


More information about the devel mailing list