Menu

#1 coding error in libfakesql.c : _impl_init (MYSQL *mysql)

open
nobody
5
2012-09-13
2004-05-20
Anonymous
No

I am using mysql2odbc-0.22-2. The _impl_init() function
has a coding error that causes a core dump in my
environment.

Here is the function in question (from libfakesql.c,
line numbers included):

583 static MYSQL *
584 _impl_init (MYSQL *mysql)
585 {
586   if (mysql == NULL)
587     {
588       if ((mysql = malloc (sizeof (MYSQL))) ==

NULL)
589 return NULL;
590 mysql->free_me = 1;
591 }
592 memset (mysql, 0, sizeof (mysql));
593
594 return mysql;
595 }
596

Line 592 should read:

592 memset ( mysql, 0, sizeof (MYSQL) );

Tx,

  • rich coco

Discussion

Anonymous
Anonymous

Add attachments
Cancel