[PATCH setup] Avoid stringop-overflow warning with gcc8
Corinna Vinschen
corinna-cygwin@cygwin.com
Sat Oct 13 14:36:00 GMT 2018
On Oct 13 13:50, Jon Turney wrote:
> On 12/10/2018 16:58, Corinna Vinschen wrote:
> > On Oct 12 16:43, Jon Turney wrote:
> [...]
> > > diff --git a/desktop.cc b/desktop.cc
> > > index 927c02f..d003e91 100644
> > > --- a/desktop.cc
> > > +++ b/desktop.cc
> > > @@ -107,7 +107,8 @@ start_menu (const std::string& title, const std::string& target,
> > > issystem ? CSIDL_COMMON_PROGRAMS :
> > > CSIDL_PROGRAMS, &id);
> > > SHGetPathFromIDList (id, path);
> > > - strncat (path, "/Cygwin", MAX_PATH);
> > > + strncat (path, "/Cygwin", MAX_PATH - strlen(path));
> >
> > Shouldn't that be
> >
> > strncat (path, "/Cygwin", MAX_PATH - strlen(path) - 1);
> >
> > ?
>
> Yes! I have no idea what I was thinking!
Better than the crime I have commited originally...
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-apps/attachments/20181013/eb8567f3/attachment.sig>
More information about the Cygwin-apps
mailing list