[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG in ltdl.c - here's a PATCH
From: |
Simon White |
Subject: |
Re: BUG in ltdl.c - here's a PATCH |
Date: |
Sat, 15 Jun 2002 04:40:48 -0500 |
Who ever it concerns,
> strncpy (filename, dir_name, sizeof (filename) - 1);
> filename[sizeof (filename) - 1] = 0;
>
> Dan
>
> > From: Lutz Müller <address@hidden>
> >
> > memset (filename, 0, sizeof (filename));
> > strncpy (filename, dir_name, sizeof (filename) - 1);
> >
>
*Cough*. You cannot use sizeof on the filename. It's a pointer and will give
you the sizeof the pointer, not the string.
After checking the length of the buffer and deciding it's not big enough you
reallocate the buffer. Once the new buffer allocates successfully it will be
the correct size, so just use strcpy as the check prevents overruns.
Simon
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
Save up to $160 by signing up for NetZero Platinum Internet service.
http://www.netzero.net/?refcd=N2P0602NEP8
- BUG in ltdl.c - here's a PATCH, Lutz Müller, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Albert Chin, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Lutz Müller, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Lutz Müller, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Albert Chin, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Bob Friesenhahn, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Albert Chin, 2002/06/14
- Re: BUG in ltdl.c - here's a PATCH, Lutz Müller, 2002/06/14