Re: [Libreoffice] Fwd: Re: cppcheck : snprintf size is out of bounds
Hi Julien, On Thu, 2010-11-18 at 22:44 +0100, Julien Nabet wrote: > The bug on cppcheck has been fixed : > https://github.com/danmar/cppcheck/commit/66c2825b2309d21474b22eb4e73e75a4b4ee150f Nice work :-) great to see the cleanup of LibO's twistedness having a positive effect on shared tooling as well. Thanks ! Michael. -- michael.me...@novell.com <><, Pseudo Engineer, itinerant idiot ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Fwd: Re: cppcheck : snprintf size is out of bounds
Le 17/11/2010 22:46, Julien Nabet a écrit : Le 17/11/2010 22:19, Caolán McNamara a écrit : On Wed, 2010-11-17 at 21:50 +0100, julien wrote: There's no more cppcheck errors if if i change the line : const sal_uInt32 nBezString = 1024; into this : sal_uInt32 nBezString = 1024; Before i create a tracker for cppcheck guy, i'd like to know what you think about it ? Yeah, that basically confirms it for me. C. I created the ticket 2210 for this bug. I noticed that sal_uInt32 is defined in sal/inc/sal/types.h and that it depended of preprocessor, perhaps it's the pb. I attached this remark in the tracker. Julien. The bug on cppcheck has been fixed : https://github.com/danmar/cppcheck/commit/66c2825b2309d21474b22eb4e73e75a4b4ee150f Julien. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Fwd: Re: cppcheck : snprintf size is out of bounds
Le 17/11/2010 22:19, Caolán McNamara a écrit : On Wed, 2010-11-17 at 21:50 +0100, julien wrote: There's no more cppcheck errors if if i change the line : const sal_uInt32 nBezString = 1024; into this : sal_uInt32 nBezString = 1024; Before i create a tracker for cppcheck guy, i'd like to know what you think about it ? Yeah, that basically confirms it for me. C. I created the ticket 2210 for this bug. I noticed that sal_uInt32 is defined in sal/inc/sal/types.h and that it depended of preprocessor, perhaps it's the pb. I attached this remark in the tracker. Julien. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] Fwd: Re: cppcheck : snprintf size is out of bounds
On Wed, 2010-11-17 at 21:50 +0100, julien wrote: > There's no more cppcheck errors if if i change the line : > const sal_uInt32 nBezString = 1024; > > into this : > sal_uInt32 nBezString = 1024; > > Before i create a tracker for cppcheck guy, i'd like to know what you > think about it ? Yeah, that basically confirms it for me. C. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] Fwd: Re: cppcheck : snprintf size is out of bounds
Le 17/11/2010 17:08, Caolán McNamara a écrit : On Fri, 2010-11-12 at 12:44 +0100, Julien wrote: Hello, I'm currently running the last version of cppcheck (i updated with git this morning) and i get this error : I don't understand where's the pb with snprintf, pString has a size of 1024 and snprintf takes a size of 1024. Is this a false positive to give to the cppcheck guys ? Well I think so. if you replace nBezString in the sprintf line with a raw 1024 does it complain ? C. After several tests, i noticed for these lines in libs-gui/vcl/unx/source/printergfx/common_gfx.cxx (from line 530): PrinterGfx::DrawPolyLineBezier (sal_uInt32 nPoints, const Point* pPath, const BYTE* pFlgAry) { const sal_uInt32 nBezString = 1024; sal_Char pString[nBezString]; if ( nPoints> 1&& maLineColor.Is()&& pPath ) { PSSetColor (maLineColor); PSSetColor (); PSSetLineWidth (); snprintf(pString, nBezString, "%li %li moveto\n", pPath[0].X(), pPath[0].Y()); There's no more cppcheck errors if if i change the line : const sal_uInt32 nBezString = 1024; into this : sal_uInt32 nBezString = 1024; Before i create a tracker for cppcheck guy, i'd like to know what you think about it ? Julien. ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice