My advise is to replace the sprintf by an snprintf before the final
release: snprintf requires an additional parameter that tells it how many
bytes the buffer it is about to write into is long; using an ordinary
sprintf always means you are risking needing to issue an security update
because someone manages to craft a file that tricks snprintf into
overwriting the stack or a pointer leading to arbitrary code execution by
using return-oriented programming or similar.

And always remember: if snprintf knows that the buffer it writes into is
only 255 bytes long and the string to write is 255 bytes long plus the null
byte marking the end of the string snprintf won't add a null byte to its
end => fill the last byte it the target string with a zero and then tell
snprintf the target is only 254 bytes long. Or make the target string
longer.

Kind regards, Gunter.

On Mon, 24 Sep 2018, 06:07 David W. Jones, <gnomeno...@gmail.com> wrote:

> On September 23, 2018 12:43:38 PM HST, Bruno Postle wrote:
> >
> >
> >On 23 September 2018 13:48:10 BST, Andreas Metzler wrote:
> >>
> >>building libpano with gcc 8 (instead of 7) triggers a couple of new
> >>warnings that might be interesting:
> >>
> >>parser.c: In function 'ReadImageDescription':
> >>parser.c:1854:38: warning: '%s' directive writing up to 65535 bytes
> >>into a region of size 256 [-Wformat-overflow=]
> >>             sprintf( sBuf.destName, "%s", buf );
> >>                                      ^~   ~~~
> >
> >It looks harmless to me, but my C isn't good enough to say for sure.
>
> Don't know, either, but I put in an effort compiling a completely
> different app that reported those kinds of warnings (trying to fit X bytes
> into something <X). Program would compile but immediately crash on run.
> Left no debug or log or anything.
>
> >Along with the earlier typos I'm inclined to release the release
> >candidate, since it has been waiting so long, then fixes for these can
> >go into the next release.
> >
> >>Also, the following warnings is thrown a couple of times in the
> >>test-suite:
> >>Comparing reference images: 2
> >>reference/tiff_m_cropped0000.tif -> tests/tiff_m_cropped0000.tif
> >>TIFFReadDirectory: Warning, Sum of Photometric type-related color
> >>channels and ExtraSamples doesn't match SamplesPerPixel. Defining
> >>non-color channels as ExtraSamples..
> >
> >Seems like libtiff didn't like something about the files rather than
> >the tests themselves failing.
>
> Sounds like an issue with files themselves, too. Have gotten used to such
> warnings with images from my camera. It simply doesn't record some of the
> things libtiff seems to look for.
>
>
> David W. Jones
> gnomeno...@gmail.com
> wandering the landscape of god
> http://dancingtreefrog.com
>
> Sent from my Android device with F/LOSS K-9 Mail.
>
> --
> A list of frequently asked questions is available at:
> http://wiki.panotools.org/Hugin_FAQ
> ---
> You received this message because you are subscribed to the Google Groups
> "hugin and other free panoramic software" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to hugin-ptx+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/hugin-ptx/FB46C7F8-A83C-4EED-B71B-A0D9B0EE90D7%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hugin-ptx+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/CAMcFxV2WpOJ2RDQEuedxNWJKpyKSEfMji0OPmfX-VNpHdOoDMQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to