Subject | RE: [ib-support] Questions about Firebird's API |
---|---|
Author | SD@topol.udm.net |
Post date | 2002-03-15T13:00:35Z |
On 14 Mar 2002 at 14:37, C R Zamana wrote:
lengths? If no, a buffer overflow is very probable.
I'd write something like
dpb_length = strlen(user)+strlen(password)+5;
dpb_buffer = (char *)malloc(dpb_length);
SY, Dimitry Sibiryakov.
> I use this approach to connect with database passing usernameDo USERNAME_SIZE and PASSWORD_SIZE macros include bytes for their
>and password and it works fine. Feel free :-)
>
>---- Code ------------------------------------------------------------
> dpb_buffer = (char *)malloc(USERNAME_SIZE+PASSWORD_SIZE+3);
lengths? If no, a buffer overflow is very probable.
I'd write something like
dpb_length = strlen(user)+strlen(password)+5;
dpb_buffer = (char *)malloc(dpb_length);
SY, Dimitry Sibiryakov.